function getPluginHelpers() { $helper_names = AkActionController::addPluginHelper(false); // Trick for getting helper names set by AkPlugin::addHelper if (empty($helper_names)) { return array(); } elseif ($this->plugin_helpers == 'all') { return $helper_names; } else { $selected_helper_names = array(); foreach (Ak::toArray($this->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; } }
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; AkActionController::addPluginHelper($helper_name, array('path' => $helper_path)); }