Closed zanbaldwin closed 13 years ago
The way to access a model from a controller is $this->model('model_name')->method();
The question is, should we let the framework user access models using $this->_models->model_name->method();
to make the loading of models easier, or make _models
private to allow only one way of accessing models?
::setModel()
has been merged into model()
, and ::setModule()
has been merged into module()
.
_autoload()
method has been completed.
Optimise the controller library - this is the super object. There must be a better way of assigning, storing, etc. modules and models than the method implemented at the moment.
Also, do the variables holding the instances need to be static? What happens when another instance of the controller object is created, eg. when a module is loaded? Should they be loaded the same way as classes?
Should they still be loaded inside the super controller and follow the
module@path/to/model
identifier pattern (@path/to/model
for application models)? But then we have the problem of how does the Load library access, and add models to, the privateself::$_models
variable without the controller having another method for setting the model, like we have implemented at the moment?Unless the super controllers
model()
method is like the following (still not ideal though):