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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -