Example #1
0
 function addHelper($helper_name, $helper_path = null)
 {
     require_once AK_LIB_DIR . DS . 'AkActionView' . DS . 'AkHelperLoader.php';
     $helper_name = AkInflector::camelize($helper_name);
     $helper_path = empty($helper_path) ? $this->getPath() . DS . 'lib' . DS . AkInflector::underscore($helper_name) . '.php' : $helper_path;
     AkHelperLoader::addPluginHelper($helper_name, array('path' => $helper_path));
 }
Example #2
0
 public function addHelper($helper_name, $helper_path = null)
 {
     $helper_name = AkInflector::camelize($helper_name);
     $helper_path = empty($helper_path) ? $this->getPath() . DS . 'lib' . DS . AkInflector::underscore($helper_name) . '.php' : $helper_path;
     AkHelperLoader::addPluginHelper($helper_name, array('path' => $helper_path));
 }
Example #3
0
 function getPluginHelperNames()
 {
     $handler =& $this->_Handler;
     $handler->plugin_helpers = !isset($handler->plugin_helpers) ? 'all' : $handler->plugin_helpers;
     $helper_names = AkHelperLoader::addPluginHelper(false);
     // Trick for getting helper names set by AkPlugin::addHelper
     if (empty($helper_names)) {
         return array();
     } elseif ($handler->plugin_helpers == 'all') {
         return $helper_names;
     } else {
         $selected_helper_names = array();
         foreach (Ak::toArray($handler->plugin_helpers) as $helper_name) {
             $helper_name = AkInflector::camelize($helper_name);
             if ($path = array_shift(array_keys($helper_names, AkInflector::camelize($helper_name)))) {
                 $selected_helper_names[$path] = $helper_names[$path];
             }
         }
         return $selected_helper_names;
     }
 }