• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie Help w/ Constructors

#1
[eluser]mdgrech[/eluser]
I have some default variables I would like to set in my __construct for all my functions do use. Where am I going wrong here?


Code:
<?php
class Test extends Controller {
        
    function __construct()
    {
        parent::Controller();
        
        $this->message = "hello!";
    }
    
    
    function index()
    {        
        echo $message;    
    }

}


Messages In This Thread
Newbie Help w/ Constructors - by El Forum - 11-02-2010, 09:31 PM
Newbie Help w/ Constructors - by El Forum - 11-02-2010, 09:58 PM
Newbie Help w/ Constructors - by El Forum - 11-02-2010, 10:38 PM
Newbie Help w/ Constructors - by El Forum - 11-02-2010, 10:40 PM
Newbie Help w/ Constructors - by El Forum - 11-02-2010, 11:21 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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