• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.