當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。