Пример #1
0
 public function testResolveResolvesTemplate()
 {
     $resolver = new TemplateResolver();
     $file = $this->filesDir . 'development.phtml';
     $resolver->setTemplate('error/development', $file);
     $this->assertSame($file, $resolver->resolve('error/development'));
 }
Пример #2
0
 /**
  * Makes the resolver.
  *
  * @return TemplateResolver The resolver
  */
 public static function make()
 {
     $resolver = new TemplateResolver();
     $services = Provider::getServices();
     $config = $services->get('Config');
     if (isset($config['error']['html']['templates'])) {
         $templates = (array) $config['error']['html']['templates'];
         foreach ($templates as $template => $path) {
             $resolver->setTemplate($template, $path);
         }
     }
     return $resolver;
 }