/** * @param HelperInterface $helper * @return $this */ public function addHelper(HelperInterface $helper) { $this->helpers[$helper->getName()] = $helper; return $this; }
/** * Sets a helper. * * @param HelperInterface $value The helper instance * @param string $alias An alias */ public function set(HelperInterface $helper, $alias = null) { $this->helpers[$helper->getName()] = $helper; if (null !== $alias) { $this->helpers[$alias] = $helper; } $helper->setEngine($this); }
/** * @param Yuhao\Helper\HelperInterface $helper */ public function add(HelperInterface $helper) { $this->helpers[$helper->getName()] = $helper; }