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


PHP Factory::addExtension方法代码示例

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


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

示例1: handle

 /**
  * Handle the command.
  *
  * @param Application $application
  * @param Factory $views
  */
 public function handle(Application $application, Factory $views)
 {
     $views->composer('*', 'Anomaly\\Streams\\Platform\\View\\ViewComposer');
     $views->addNamespace('streams', __DIR__ . '/../../../resources/views');
     $views->addNamespace('resources', base_path('resources/views'));
     $views->addNamespace('storage', $application->getStoragePath());
     $views->addNamespace('app', $application->getResourcesPath());
     $views->addNamespace('root', base_path());
     $views->addExtension('html', 'php');
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:16,代码来源:AddViewNamespaces.php

示例2: addExtension

 /**
  * Register a valid view extension and its engine.
  *
  * @param string $extension
  * @param string $engine
  * @param \Closure $resolver
  * @return void 
  * @static 
  */
 public static function addExtension($extension, $engine, $resolver = null)
 {
     \Illuminate\View\Factory::addExtension($extension, $engine, $resolver);
 }
开发者ID:satriashp,项目名称:tour,代码行数:13,代码来源:_ide_helper.php

示例3: registerViewFactory

 /**
  * Register the view factory. The factory is
  * available in all views.
  */
 protected function registerViewFactory()
 {
     // Register the View Finder first.
     $this->app->singleton('view.finder', function ($container) {
         return new ViewFinder($container['filesystem'], [], ['blade.php', 'scout.php', 'twig', 'php']);
     });
     $this->app->singleton('view', function ($container) {
         $factory = new Factory($container['view.engine.resolver'], $container['view.finder'], $container['events']);
         // Set the container.
         $factory->setContainer($container);
         // Tell the factory to also handle the scout template for backwards compatibility.
         $factory->addExtension('scout.php', 'blade');
         // Tell the factory to handle twig extension files and assign them to the twig engine.
         $factory->addExtension('twig', 'twig');
         // We will also set the container instance on this view environment since the
         // view composers may be classes registered in the container, which allows
         // for great testable, flexible composers for the application developer.
         $factory->setContainer($container);
         $factory->share('app', $container);
         return $factory;
     });
 }
开发者ID:themosis,项目名称:framework,代码行数:26,代码来源:ViewServiceProvider.php


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