setHandler() public static method

set handler
public static setHandler ( FrontendHandler $handler ) : void
$handler Xpressengine\Presenter\Html\FrontendHandler frontend handler
return void
 /**
  * register frontend
  *
  * @return void
  */
 private function registerFrontend()
 {
     $this->app->singleton(['xe.frontend' => FrontendHandler::class], function ($app) {
         $tags = ['title' => \Xpressengine\Presenter\Html\Tags\Title::class, 'meta' => \Xpressengine\Presenter\Html\Tags\Meta::class, 'icon' => \Xpressengine\Presenter\Html\Tags\IconFile::class, 'css' => \Xpressengine\Presenter\Html\Tags\CSSFile::class, 'js' => \Xpressengine\Presenter\Html\Tags\JSFile::class, 'bodyClass' => \Xpressengine\Presenter\Html\Tags\BodyClass::class, 'html' => \Xpressengine\Presenter\Html\Tags\Html::class, 'rule' => \Xpressengine\Presenter\Html\Tags\Rule::class, 'translation' => \Xpressengine\Presenter\Html\Tags\Translation::class, 'package' => \Xpressengine\Presenter\Html\Tags\Package::class];
         $frontendHandler = $app['xe.interception']->proxy(FrontendHandler::class, 'XeFrontend');
         $frontendHandler = new $frontendHandler($tags);
         // inject frontend handler to Package
         \Xpressengine\Presenter\Html\Tags\Package::setHandler($frontendHandler);
         return $frontendHandler;
     });
 }
Example #2
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     Package::init();
     Package::setHandler($this->getHandler());
     parent::setUp();
 }