示例#1
0
 /**
  * Constructor.
  *
  * @param ContainerInterface $container
  */
 public function __construct(ContainerInterface $container)
 {
     $this->container = $container;
     //set the options manager
     if ($this->container->has('services.option_manager')) {
         $this->om = $this->get('services.option_manager');
     } else {
         $this->om = $this->container->getRoot()->get('services.option_manager');
     }
     //set the template manager
     if ($this->container->has('services.template_manager')) {
         $this->tm = $this->get('services.template_manager');
     } else {
         $this->tm = new TemplateManager($this->container);
     }
     //set the cache holder we must set an interface with default cache implementation
     if ($this->container->has('services.cache_manager')) {
         $this->cm = $this->get('services.cache_manager');
     } else {
         $this->cm = $this->container->getRoot()->get('services.cache_manager');
     }
 }