Welcome Guest, Not a member yet? Register   Sign In
undefined property
#3

[eluser]f0n3man[/eluser]
Most of this code came from one of the wiki tutorials. I modified it in attempts to make it work. The controller is:
Code:
class Site extends Controller
{
    
    function Site()
    {
        parent::Controller();
        $this->load->helper('url');
        $this->load->helper('form');
        $this->output->enable_profiler(TRUE);
    }
    
    function index()
    {
        $data['records'] = $this->site_model->get_records();
        $this->load->view('site_view', $data);
    }
and the model is:
Code:
class Site_model extends Model {
    
function Site_model()
    {
        // Call the Model constructor
        parent::Model();
        $this->load->database();
    }
    
    function get_records()
    {
        $query = $this->db->get('data');
        return $query->result();
    }

Since I'm absolutely new to OOP programming, I'm guessing it's something simple.


Messages In This Thread
undefined property - by El Forum - 10-07-2010, 10:13 AM
undefined property - by El Forum - 10-07-2010, 10:25 AM
undefined property - by El Forum - 10-07-2010, 12:51 PM
undefined property - by El Forum - 10-07-2010, 12:53 PM
undefined property - by El Forum - 10-07-2010, 01:09 PM
undefined property - by El Forum - 10-07-2010, 01:30 PM
undefined property - by El Forum - 10-07-2010, 02:00 PM
undefined property - by El Forum - 10-07-2010, 04:56 PM
undefined property - by El Forum - 10-07-2010, 05:12 PM
undefined property - by El Forum - 10-07-2010, 05:17 PM
undefined property - by El Forum - 10-08-2010, 08:21 AM
undefined property - by El Forum - 10-08-2010, 12:26 PM
undefined property - by El Forum - 10-08-2010, 01:32 PM
undefined property - by El Forum - 10-08-2010, 01:40 PM
undefined property - by El Forum - 10-09-2010, 12:20 AM
undefined property - by El Forum - 10-09-2010, 05:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB