Example #1
0
 /**
  * Direct helper implementation:
  *  - return service if exists
  *  - else return parameter if exists
  *
  * @param  string $name
  */
 public function direct($name)
 {
     if ($this->_container->has($name)) {
         return $this->_container->getService($name);
     } else {
         if ($this->_container->getParameterBag()->has($name)) {
             return $this->_container->getParameter($name);
         }
     }
     return null;
 }