Welcome Guest, Not a member yet? Register   Sign In
how declare variable inside constructor?
#1

[eluser]ranjitbd[/eluser]
class Holiday extends Controller {

function Holiday()
{
parent::Controller();
$data = array(); // can i declare a variable like this in a constructor

}

function access_variable()
{
//want to access that variable like this
$data['name'] = 'ranjit'; // will it work?even i want to access this $data
//in all methods in the controller.
}
}
?>


Messages In This Thread
how declare variable inside constructor? - by El Forum - 09-02-2009, 12:38 AM
how declare variable inside constructor? - by El Forum - 09-02-2009, 01:14 AM
how declare variable inside constructor? - by El Forum - 09-02-2009, 05:42 AM
how declare variable inside constructor? - by El Forum - 09-25-2009, 12:54 AM
how declare variable inside constructor? - by El Forum - 09-25-2009, 02:02 AM
how declare variable inside constructor? - by El Forum - 09-25-2009, 07:50 AM
how declare variable inside constructor? - by El Forum - 07-19-2011, 07:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB