Welcome Guest, Not a member yet? Register   Sign In
Undefined property: My_controller::$load
#1

[eluser]Peter Dräxler[/eluser]
Hi guys.

My Controller:
Code:
class Export extends Controller {
    
    function Export()
    {
        log_message('debug', 'Export Controller Initialized');
    }    
    
    function index($page = 0)
    {
        $this->load->model('Product_model');
        
        define('FOR_ONE_QUERY', 5000);
        define('SUPPLIER_ID', 3);
        define('COUNT_PRODUCTS', $this->Product_model->count_supplier_products(SUPPLIER_ID));
                
        echo $this->config->system_url(). "<br>";
        echo $this->config->site_url();
        $query = $this->Product_model->get_supplier_products(SUPPLIER_ID, FOR_ONE_QUERY, ($page*FOR_ONE_QUERY));
    }
}

My output:
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: Export::$load

Filename: controllers/export.php

Line Number: 17


Fatal error: Call to a member function model() on a non-object in /home/dttrading/compmania.sk/nevilel/velkoporovnavac/system/application/controllers/export.php on line 17

My log (edited):
Quote:|0| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Config Class Initialized
|-----------------------------------------------------------------------------|
|1| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Hooks Class Initialized
|-----------------------------------------------------------------------------|
|2| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; URI Class Initialized
|-----------------------------------------------------------------------------|
|3| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Router Class Initialized
|-----------------------------------------------------------------------------|
|4| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Output Class Initialized
|-----------------------------------------------------------------------------|
|5| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Input Class Initialized
|-----------------------------------------------------------------------------|
|6| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Global POST and COOKIE data sanitized
|-----------------------------------------------------------------------------|
|7| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Language Class Initialized
|-----------------------------------------------------------------------------|
|8| DEBUG - 2010-08-17 19:18:56 (./export) --&gt; Export Controller Initialized
|-----------------------------------------------------------------------------|
|9| ERROR - 2010-08-17 19:18:56 (./export) --&gt; Severity: Notice --&gt; Undefined property: Export::$load /home/dttrading/compmania.sk/nevilel/velkoporovnavac/system/application/controllers/export.php 17
|-----------------------------------------------------------------------------

Live versions: Live page, Live log

Where is the problem? Other controllers works correctly.
Please help me.
#2

[eluser]danmontgomery[/eluser]
Code:
function Export()
    {
        parent::Controller();
        log_message('debug', 'Export Controller Initialized');
    }
#3

[eluser]Peter Dräxler[/eluser]
Thank you :-)




Theme © iAndrew 2016 - Forum software by © MyBB