• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem array in my view...

#1
[eluser]Unknown[/eluser]
Hello,

I begin on codeigniter and I have a problem.

In my view, I have:

Quote:Severity: Notice

Message: Undefined variable: data

In my controller:

Code:
class JobName extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->helper(array('form', 'url'));
        $this->load->model('user_model');
        $this->load->view('_partials/header');
        $this->load->view('_partials/footer');
    }

    public function index() {
        $data = $this->user_model->getNameJob();
        if (!is_array($data)) {
            $data = array();
        }
        var_dump($data);
        $this->load->view('listJob', array('listjob' => $data));
    }

}

And in my model :

Code:
public function getNameJob() {
        $query = $this->db->get('namejob');
        return $query->result_array();
    }

Could you help me?

Thanks a lot !


Messages In This Thread
Problem array in my view... - by El Forum - 05-30-2013, 01:46 PM
Problem array in my view... - by El Forum - 05-30-2013, 02:59 PM
Problem array in my view... - by El Forum - 05-31-2013, 03:31 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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