Welcome Guest, Not a member yet? Register   Sign In
Undefined index
#5

[eluser]matt2012[/eluser]
Still having problems with this - thanks for your help but im still not getting it,

here's the problem again,


Code:
class Welcome extends Controller {

var $data = array();

    
    function  Welcome()
     {

    /////want this for all functions in controller - actually maybe all functions in all controllers?/////

    $data['js'] = array('init');
    $data['css'] = array('style');
    $data['page'] = 'home';
    $data['topform'] = 'login';
    $data['title'] = 'mysite| home';
    $data['keywords'] = 'great site';
    $data['description'] = 'this site is a ...';    
    $data['message'] = '';
  
        parent::Controller();    
        }

        function index()
        {
        //leave default settings set in constructor
        $this->load->view('container', $data);

        }

        function foo()
        {
        //overwrite title variable pass on rest unchanged
        $data['title'] = 'easy2health | foo';
        $this->load->view('container', $data);
        }

hope you can help its a real stumbling block that I think will help me understand classes and how they work a lot better!


Messages In This Thread
Undefined index - by El Forum - 06-30-2007, 09:50 AM
Undefined index - by El Forum - 06-30-2007, 11:22 AM
Undefined index - by El Forum - 06-30-2007, 04:28 PM
Undefined index - by El Forum - 06-30-2007, 11:57 PM
Undefined index - by El Forum - 07-01-2007, 04:16 AM
Undefined index - by El Forum - 07-01-2007, 06:15 AM
Undefined index - by El Forum - 07-01-2007, 10:20 AM
Undefined index - by El Forum - 07-01-2007, 02:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB