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


PHP View::addLocation方法代码示例

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


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

示例1: boot

 /**
  * Alias the services in the boot.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/PublishedAssets/Views/themes' => base_path('resources/themes'), __DIR__ . '/PublishedAssets/Controllers' => app_path('Http/Controllers/Quarx'), __DIR__ . '/Migrations' => base_path('database/migrations'), __DIR__ . '/PublishedAssets/Middleware' => app_path('Http/Middleware'), __DIR__ . '/PublishedAssets/Routes' => base_path('routes'), __DIR__ . '/PublishedAssets/Config' => base_path('config')]);
     $theme = Config::get('quarx.frontend-theme', 'default');
     $this->loadViewsFrom(__DIR__ . '/Views', 'quarx');
     View::addLocation(base_path('resources/themes/' . $theme));
     View::addNamespace('quarx-frontend', base_path('resources/themes/' . $theme));
     /*
     |--------------------------------------------------------------------------
     | Blade Directives
     |--------------------------------------------------------------------------
     */
     Blade::directive('theme', function ($expression) {
         if (Str::startsWith($expression, '(')) {
             $expression = substr($expression, 1, -1);
         }
         $theme = Config::get('quarx.frontend-theme');
         $view = '"quarx-frontend::' . str_replace('"', '', str_replace("'", '', $expression)) . '"';
         return "<?php echo \$__env->make({$view}, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>";
     });
     Blade::directive('menu', function ($expression) {
         return "<?php echo Quarx::menu({$expression}); ?>";
     });
     Blade::directive('widget', function ($expression) {
         return "<?php echo Quarx::widget({$expression}); ?>";
     });
     Blade::directive('images', function ($expression) {
         return "<?php echo Quarx::images({$expression}); ?>";
     });
     Blade::directive('edit', function ($expression) {
         return "<?php echo Quarx::editBtn({$expression}); ?>";
     });
     Blade::directive('markdown', function ($expression) {
         return "<?php echo Markdown::convertToHtml({$expression}); ?>";
     });
 }
开发者ID:YABhq,项目名称:Quarx,代码行数:41,代码来源:QuarxProvider.php

示例2: registerViewPath

 /**
  * Define the "web" routes for the application.
  *
  * These routes all receive session state, CSRF protection, etc.
  *
  * @return void
  */
 protected function registerViewPath()
 {
     View::addLocation(__DIR__ . "/views");
 }
开发者ID:mage2,项目名称:project-management-system,代码行数:11,代码来源:Module.php


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