cakephp helper call function of other helper -


what trying achieve automate helpers loading scripts , css. idea have function on every helper, loading scripts / styles used dedicated helper. guess can achieved having controlling helper querying active helpers , execute script/style loading function.

what cannot find in documentation is:

  • how can helper query list of active helper objects

you can query helperregistry of view using (see view::helpers):

$this->_view->helpers(); 

once have registry, can names of loaded helper using helperregistry::loaded() , retrieve them using helperregistry::get():

// inside helper: $registry = $this->_view->helpers(); foreach ($registry->loaded() $name) {     $helper = $registry->get($name); } 

disclaimer: code above not tested.


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -