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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -