Welcome Guest, Not a member yet? Register   Sign In
Creating data in constructor
#3

[eluser]bertcarremans[/eluser]
Thanks mdvaldosta,

but do you mean with putting $data as a class variable that I have to state

Code:
public $data;

at the top of the Controller class? If yes, I already tried this, but it does not work.
Could it perhaps be that in the home function I also add extra information to the $data array?

Code:
function home() {
        // Some code here ...

        // Data array
        $data = array(
            'title'=>'This is the title',
            'pagina'=>'home'
        );

        // Some code here ...
    }

Does this adding of extra information overwrite the $data array created in the constructor?

Thanks!


Messages In This Thread
Creating data in constructor - by El Forum - 12-31-2010, 06:33 AM
Creating data in constructor - by El Forum - 12-31-2010, 07:12 AM
Creating data in constructor - by El Forum - 12-31-2010, 07:22 AM
Creating data in constructor - by El Forum - 12-31-2010, 07:50 AM
Creating data in constructor - by El Forum - 01-01-2011, 03:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB