当前位置: 首页>>代码示例>>PHP>>正文


PHP Factory::getEngineResolver方法代码示例

本文整理汇总了PHP中Illuminate\Contracts\View\Factory::getEngineResolver方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getEngineResolver方法的具体用法?PHP Factory::getEngineResolver怎么用?PHP Factory::getEngineResolver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Contracts\View\Factory的用法示例。


在下文中一共展示了Factory::getEngineResolver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setupBlade

 /**
  * Setup the blade compiler class.
  *
  * @param \Illuminate\Contracts\View\Factory $view
  *
  * @return void
  */
 protected function setupBlade(View $view)
 {
     $blade = $view->getEngineResolver()->resolve('blade')->getCompiler();
     $blade->directive('auth', function ($expression) {
         return "<?php if (\\GrahamCampbell\\Credentials\\Facades\\Credentials::check() && \\GrahamCampbell\\Credentials\\Facades\\Credentials::hasAccess{$expression}): ?>";
     });
     $blade->directive('endauth', function () {
         return '<?php endif; ?>';
     });
 }
开发者ID:abcsun,项目名称:Credentials,代码行数:17,代码来源:CredentialsServiceProvider.php

示例2: setupBlade

 /**
  * Setup the blade compiler class.
  *
  * @param \Illuminate\Contracts\View\Factory $view
  *
  * @return void
  */
 protected function setupBlade(View $view)
 {
     $blade = $view->getEngineResolver()->resolve('blade')->getCompiler();
     $blade->extend(function ($value, $compiler) {
         $pattern = $compiler->createMatcher('auth');
         $replace = '$1<?php if (\\App\\Facades\\Credentials::check() && \\App\\Facades\\Credentials::hasAccess$2): ?>';
         return preg_replace($pattern, $replace, $value);
     });
     $blade->extend(function ($value, $compiler) {
         $pattern = $compiler->createPlainMatcher('endauth');
         $replace = '$1<?php endif; ?>$2';
         return preg_replace($pattern, $replace, $value);
     });
 }
开发者ID:xhulioh25,项目名称:wiki,代码行数:21,代码来源:CredentialsServiceProvider.php

示例3: boot

 /**
  * boot.
  *
  * @method boot
  *
  * @param \Illuminate\Contracts\Http\Kernel $kernel
  * @param \Illuminate\Contracts\View\Factory $view
  */
 public function boot(Kernel $kernel, View $view)
 {
     if ($this->app->runningInConsole() === true) {
         $this->publishes([__DIR__ . '/../config/tracy.php' => $this->app->configPath() . '/tracy.php'], 'config');
         return;
     }
     if ($this->app['config']['tracy']['enabled'] === true) {
         $this->app->extend(ExceptionHandler::class, function ($exceptionHandler, $app) {
             return $app->make(Handler::class, ['exceptionHandler' => $exceptionHandler]);
         });
         $kernel->prependMiddleware(Dispatch::class);
     }
     $view->getEngineResolver()->resolve('blade')->getCompiler()->directive('bdump', function ($expression) {
         return "<?php \\Tracy\\Debugger::barDump({$expression}); ?>";
     });
 }
开发者ID:recca0120,项目名称:laravel-tracy,代码行数:24,代码来源:LaravelTracyServiceProvider.php


注:本文中的Illuminate\Contracts\View\Factory::getEngineResolver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。