I used cakePHP which has a nice feature where the model (if present is already created as a property within your controllers, so effectively I would have access to a property named $this->model_name within my controller without having the create an instance of the model object.
From what I understand all properties must be defined in a class to be able to use it, so is there another way for me to be able to complete the above?
// Sample code:
<?php
class controller {
public function create_model($model_name) {
// Assuming that I have spl_autoload enabled to achieve the below:
$this->$$model_name = new model_name();
}
}