_action = $action; } /** * get action helper by name * * @param string $name * * @throws \InvalidArgumentException * @return \Cube\Controller\Action\Helper\AbstractHelper */ public function getHelper($name) { $className = '\\' . __NAMESPACE__ . '\\' . ucfirst($name); if (class_exists($className)) { /** @var \Cube\Controller\Action\Helper\AbstractHelper $helper */ $helper = new $className(); $helper->setAction($this->_action); } else { throw new \InvalidArgumentException( sprintf("The action helper '%s' does not exist.", $className)); } return $helper; } /** * @param string $name * @param mixed $arguments * * @return \Cube\Controller\Action\Helper\AbstractHelper */ public function __call($name, $arguments) { return $this->getHelper($name); } }