php - How to call a function inside the bootstrap from a model in Zend? -
i have function on bootstrap.php like:
function test() { echo "hello"; }
i want call model. know can controller using $this->getfrontcontroller()->getparam('bootstrap')->test();
no clue on how model. help?
i know it's not best have function on bootstrap , better have elsewhere, can't happen.
you can front controller
anywhere in application using zend.controller.front.methods.primary.getinstance
$front = zend_controller_front::getinstance();
so think give result
$front = zend_controller_front::getinstance(); $front->getparam('bootstrap')->test();
Comments
Post a Comment