Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Controller{
- public function load(){
- return $this->load;
- }
- public function model($name ){
- require $name;
- $modname = $name . '_Model';
- $this->$name = new $modname();
- }
- }
- class whatever extends Controller {
- function __construct() {
- parent::__construct();
- $this->model('Login'); //WORK
- $this->load->model('Login'); //NOT WORK (MY PROBLEM)
- }
- function Sigin(){
- $this->Login->anothermodelfunction; //WORK with $this->model('Login')
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement