Welcome Guest, Not a member yet? Register   Sign In
Can't send data from controller to view - variable scope problem?
#2

[eluser]InsiteFX[/eluser]
Code:
<?php

class Home extends CI_Controller {

    public function __construct() {

        parent::__construct();

        // Initializes connection data
        $data['connection'] = array(
            'logged' => TRUE,
            'username' => 'duarte',
        );
        
        if ($data['connection']['logged'] == TRUE) {
            $this->load->view('templates/logged',$data);
        } else {
            $this->load->view('templates/login');
        }
    }
}

You should moce the view stuff to the index method.


Messages In This Thread
Can't send data from controller to view - variable scope problem? - by El Forum - 08-30-2013, 05:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB