Normally models are loaded through require_once() or Zend_Loader::loadClass()
with painfully long paths similar to "module/models/Model.php" or
"module/models/controller/Model.php" and more likely
"../models/controller/Model.php". After a few discussions on #zftalk with
ralphschindler, SpotSec_Controller_Action_Helper_ModelLoader came to
existence. ModelLoader does exactly what the name says, it makes loading
models one step simpler by determining the path to the models folder so all
you have to do is specify the model's class name.
Anyways I just wanted to see some feedback, as I never actually tested it
and feel it is useless...
If you are using the conventional modular directory structure then
ModelLoader is already setup and ready to go. If you are not then you can
setup ModelLoader using __construct();
Usage: $this->_helper->ModelLoader('UserModel');
link in proposal form:
http://svn.ralphschindler.com/repo/ZendFramework/Zend_Controller-ModelLoader/library/Zend/Controller/Action/Helper/ModelLoader.php
ModelLoading helper
--------
http://www.spotsec.com SpotSec
--
View this message in context:
http://www.nabble.com/Model-Loading-helper-tf3942096s16154.html#a11181598
Sent from the Zend Framework mailing list archive at Nabble.com.