/ Published in: PHP
A small snippet on how to create a dynamic model in CakePHP (useful for global functions that need a model to function. IE functions defined in the AppController
Expand |
Embed | Plain Text
<?php // THE DYNAMIC MODEL App::Import('Model', $model); $this->DynamicModel = new $model; // USAGE EXAMPLE function getModelColumns($model){ App::Import('Model', $model); $this->DynamicModel = new $model; } ?>
You need to login to post a comment.
