Latte\Engine::setAutoRefresh PHP Method

setAutoRefresh() public method

Sets auto-refresh mode.
public setAutoRefresh ( $on = TRUE ) : static
return static
    public function setAutoRefresh($on = TRUE)
    {
        $this->autoRefresh = (bool) $on;
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Register the application services.
  *
  * @return void
  * @throws \InvalidArgumentException
  */
 public function register()
 {
     $this->app->singleton('latte.engine', function ($app) {
         $latte = new Latte\Engine();
         $latte->setAutoRefresh($app['config']['app.debug']);
         $latte->setTempDirectory($app['config']['view.compiled']);
         return $latte;
     });
     $this->app->resolving('view', function (Factory $viewFactory, Application $app) {
         if ($viewFactory instanceof \Illuminate\View\Factory) {
             $viewFactory->addExtension('latte', 'latte', function () use($app) {
                 return new LatteEngineBridge($app['latte.engine']);
             });
         } else {
             throw new \InvalidArgumentException('Can\'t register Latte\\Engine, ' . get_class($viewFactory) . ' view factory is not supported.');
         }
     });
 }
All Usage Examples Of Latte\Engine::setAutoRefresh