/**
  * @param HelperInterface $helper
  * @return $this
  */
 public function addHelper(HelperInterface $helper)
 {
     $this->helpers[$helper->getName()] = $helper;
     return $this;
 }
Exemple #2
0
 /**
  * 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);
 }
Exemple #3
0
 /**
  * @param Yuhao\Helper\HelperInterface $helper
  */
 public function add(HelperInterface $helper)
 {
     $this->helpers[$helper->getName()] = $helper;
 }