Welcome Guest, Not a member yet? Register   Sign In
$this->load->model('Blog')
#14

[eluser]squall15[/eluser]
[quote author="Michael Wales" date="1265342208"]squall - yours should work as long as you call Controller's constructor from MY_Controller's constructor:

Code:
parent::Controller();
[/quote]

Thanks for suggestion. But I did.

Here's how I did it.

Controller:
Code:
class User extends MY_Controller {
  public function User() {
    parent::MY_Controller();
    $this->load->model('user_model');
    $this->user_model->validate_user();        // Giving me error here...
  }
}

Extended Controller:
Code:
class MY_Controller extends Controller {
  public function MY_Controller() {
    parent::Controller();
  }
}

Model:
Code:
class User_model extends Model {
  public function User_model() {
    parent::Model();
  }

  public function validate_user() {
    echo '123';
  }
}


Messages In This Thread
$this->load->model('Blog') - by El Forum - 02-04-2010, 12:21 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 12:28 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 12:43 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 12:55 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 01:19 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 01:25 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 01:31 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 01:41 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 01:49 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 02:03 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 03:18 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 03:54 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 03:56 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 04:33 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 04:50 PM
$this->load->model('Blog') - by El Forum - 02-04-2010, 05:14 PM
$this->load->model('Blog') - by El Forum - 02-05-2010, 09:23 PM
$this->load->model('Blog') - by El Forum - 02-06-2010, 07:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB