Welcome Guest, Not a member yet? Register   Sign In
[Solved] Cannot get model in 'Hello World' project to work - getting undefined variable notice
#7

[eluser]therealmaloy[/eluser]
wild, controller should be like this with your coding approach:

<?php

class Blahg extends Controller {

function Blahg() {
parent::Controller();
}

function index() {

$data['page_title'] = WEBSITE_TITLE.' | Blahg List';

$this->load->model('Posts_model','posts');

if($this->posts)
echo "Success";
else
echo "Failure";

$data['posts'] = $this->posts->get_posts(10);

$this->load->view('blahg_view', $data);
}

}

?>


Messages In This Thread
[Solved] Cannot get model in 'Hello World' project to work - getting undefined variable notice - by El Forum - 07-07-2008, 03:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB