コード例 #1
0
ファイル: Factory.php プロジェクト: nova-framework/cms
 /**
  * Register a valid view extension and its engine.
  *
  * @param  string   $extension
  * @param  string   $engine
  * @param  Closure  $resolver
  * @return void
  */
 public function addExtension($extension, $engine, $resolver = null)
 {
     $this->finder->addExtension($extension);
     if (isset($resolver)) {
         $this->engines->register($engine, $resolver);
     }
     unset($this->extensions[$extension]);
     $this->extensions = array_merge(array($extension => $engine), $this->extensions);
 }
コード例 #2
0
 /**
  * Register the PHP engine implementation.
  *
  * @param  \Nova\View\Engines\EngineResolver  $resolver
  * @return void
  */
 public function registerPhpEngine($resolver)
 {
     $resolver->register('php', function () {
         return new PhpEngine();
     });
 }