load() 공개 메소드

Loads a template.
public load ( Symfony\Component\Templating\TemplateReferenceInterface $template ) : Symfony\Component\Templating\Storage\Storage | boolean
$template Symfony\Component\Templating\TemplateReferenceInterface A template
리턴 Symfony\Component\Templating\Storage\Storage | boolean false if the template cannot be loaded, a Storage instance otherwise
예제 #1
0
 public function load(TemplateReferenceInterface $template)
 {
     $file = $template->get('name');
     foreach ($this->paths as $path) {
         $template->set('name', $path . '/' . $file);
         $result = parent::load($template);
         if ($result) {
             return $result;
         }
     }
     return false;
 }
예제 #2
0
 /**
  * @param \Symfony\Component\Templating\TemplateReferenceInterface $template
  * @return bool|\Symfony\Component\Templating\Loader\Storage|\Symfony\Component\Templating\Storage\Storage
  */
 public function load(TemplateReferenceInterface $template)
 {
     $filename = $this->locator->locate($template);
     $template->set('name', $filename);
     return parent::load($template);
 }