Welcome Guest, Not a member yet? Register   Sign In
pass variable to template file
#5

[eluser]mazdaFan[/eluser]
Thanks you!

Working code:
Code:
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends Controller {
    var $data = array();
    
    function MY_Controller()
    {
        parent::Controller();
        $this->data['menu'] = 'menu1, menu2...';
    }
}
and...
Code:
class Welcome extends MY_Controller {

    var $data = array();
    
    function Welcome()
    {
        parent::MY_Controller();
    }
    
    function index()
    {
        $this->data['todo_list'] = array('Clean House', 'Call Mom', 'Run Errands');    
        $this->load->view('welcome_message', $data);
    }


Messages In This Thread
pass variable to template file - by El Forum - 07-06-2009, 05:35 AM
pass variable to template file - by El Forum - 07-06-2009, 05:42 AM
pass variable to template file - by El Forum - 07-06-2009, 07:21 AM
pass variable to template file - by El Forum - 07-06-2009, 07:54 AM
pass variable to template file - by El Forum - 07-06-2009, 08:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB