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


PHP View::addNamespace方法代码示例

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


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

示例1: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('vizioart/cookbook');
     //define a constant that the rest of the package can use to conditionally use pieces of Laravel 4.1.x vs. 4.0.x
     $this->app['cookbook.4.1'] = version_compare(\Illuminate\Foundation\Application::VERSION, '4.1') > -1;
     //set up an alias for the base laravel controller to accommodate >=4.1 and <4.1
     if (!class_exists('LaravelBaseController')) {
         // Verify alias is not already created
         if ($this->app['cookbook.4.1']) {
             class_alias('Illuminate\\Routing\\Controller', 'LaravelBaseController');
         } else {
             class_alias('Illuminate\\Routing\\Controllers\\Controller', 'LaravelBaseController');
         }
     }
     // Repositories
     // --------------------------------------------------------------
     $this->bootRepositories();
     // Handlebars Templates
     // --------------------------------------------------------------
     $frontend_templates_path = public_path() . DIRECTORY_SEPARATOR . $this->app['config']->get('cookbook::cookbook.front_templates');
     View::addNamespace('hbs', $frontend_templates_path);
     include __DIR__ . '/../../filters.php';
     include __DIR__ . '/../../viewComposer.php';
     include __DIR__ . '/../../routes.php';
 }
开发者ID:ayurved,项目名称:Ayurveda,代码行数:30,代码来源:CookbookServiceProvider.php

示例2: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     parent::register();
     $this->registerAliases();
     $this->requireFiles($this->filesToRegister);
     // Define view namespace, as $this->package() doesn't exist anymore in L5
     View::addNamespace('shift', realpath(__DIR__ . '/../../views'));
 }
开发者ID:kamaroly,项目名称:shift,代码行数:13,代码来源:ShiftServiceProvider.php

示例3: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/../../../public' => public_path('packages/devnullsoftware/api-generator')], 'public');
     View::addNamespace('ApiGenerator', __DIR__ . '/../../views');
     if (env('EXPOSE_APIS', true)) {
         Route::get('/apis', 'DevnullSoftware\\ApiGenerator\\DocsController@apis2Welcome');
         Route::get('apis/data', 'DevnullSoftware\\ApiGenerator\\DocsController@apis');
         Route::get('/apis/{api}', 'DevnullSoftware\\ApiGenerator\\DocsController@apis2');
     }
 }
开发者ID:devnullsoftware,项目名称:api-generator,代码行数:15,代码来源:ApiGeneratorServiceProvider.php

示例4: __construct

 public function __construct()
 {
     $this->config = (include __DIR__ . '/../Config/cms.php');
     $this->sitemap = new Sitemap();
     $this->tree = $this->sitemap->getNestedArrayOfAllPages();
     $templateViewDir = __DIR__ . '/../Templates';
     $adminViewDir = __DIR__ . '/../Views';
     View::addNamespace('cms', $templateViewDir);
     View::addNamespace('cmsAdmin', $adminViewDir);
 }
开发者ID:ThePaavero,项目名称:cms,代码行数:10,代码来源:Cms.php

示例5: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->package('selmonal/imagemanager');
     $path = realpath(__DIR__ . "/../../views");
     // naming views
     View::addNamespace('SIM', $path);
     App::bind('Selmonal\\Imagemanager\\ImageRepositoryInterface', 'Selmonal\\Imagemanager\\EloquentImageRepository');
     // Intervention image manipulator
     App::register("Intervention\\Image\\ImageServiceProvider");
     $this->app->bind("Selmonal\\Imagemanager\\ImageManipulator", function () {
         $basePath = public_path() . Config::get("imagemanager::basePath");
         $sizes = Config::get("imagemanager::sizes");
         return new \Selmonal\Imagemanager\ImageManipulator($basePath, $sizes);
     });
 }
开发者ID:selmonal,项目名称:imagemanager,代码行数:20,代码来源:ImagemanagerServiceProvider.php

示例6: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     if (!$this->app->routesAreCached()) {
         $this->map();
     }
     View::addNamespace('TrungtnmBackend', __DIR__ . '/resources/views');
     $this->loadViewsFrom(base_path('resources/views/trungtnm/backend'), 'TrungtnmBackend');
     $this->loadViewsFrom(__DIR__ . '/resources/views', 'TrungtnmBackend');
     //publish views, configs
     $this->publishes([__DIR__ . '/resources/views' => base_path('resources/views/trungtnm/backend')]);
     $this->publishes([__DIR__ . '/resources/assets' => public_path('vendor/trungtnm/backend')], 'public');
     $this->publishes([__DIR__ . '/config/trungtnm.backend.php' => config_path('trungtnm.backend.php')], 'config');
     $this->mergeConfigFrom(__DIR__ . '/config/trungtnm.backend.php', 'trungtnm.backend');
     $this->filterPermission();
     $this->extendValidator();
 }
开发者ID:trungtnm,项目名称:backend,代码行数:21,代码来源:TrungtnmBackendServiceProvider.php

示例7: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('cherryoff/nbblog');
     /**
      * Регистрируем наши роуты
      */
     include __DIR__ . '/../../routes.php';
     /**
      * Подключаем собственный viewComposers
      */
     include __DIR__ . '/../../viewComposers.php';
     /**
      * Разрешаем обращаться к видам вне модуля
      */
     View::addNamespace('blog', __DIR__ . '/../../views');
 }
开发者ID:cherryoff,项目名称:nbblog,代码行数:21,代码来源:NbblogServiceProvider.php

示例8: 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

示例9: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     View::addNamespace('profile', __DIR__ . '/../../views');
 }
开发者ID:lyovkin,项目名称:v2board,代码行数:9,代码来源:ProfileServiceProvider.php

示例10: __construct

 public function __construct()
 {
     View::addNamespace('frontend', __DIR__ . '/../views');
 }
开发者ID:parabol,项目名称:laravel-cms,代码行数:4,代码来源:HomeController.php

示例11: __construct

 public function __construct($currentPageObject)
 {
     $this->currentPageObject = $currentPageObject;
     View::addNamespace('pageControls', __DIR__ . '/views');
 }
开发者ID:ThePaavero,项目名称:cms,代码行数:5,代码来源:Controls.php

示例12: boot

 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     View::addNamespace('Theme', base_path() . '/themes/' . env('THEME') . '/views');
     parent::boot($router);
 }
开发者ID:edgarravenhorst,项目名称:larabuild,代码行数:12,代码来源:ThemeServiceProvider.php

示例13: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     View::addNamespace('admin', app_path('Modules/Admin/Views'));
     View::addNamespace('user', app_path('Modules/User/Views'));
     View::addNamespace('shared', app_path('Modules/Shared/Views'));
 }
开发者ID:dagmawiyehenew,项目名称:laravel-levapp,代码行数:11,代码来源:AppServiceProvider.php

示例14: registerViews

 protected function registerViews()
 {
     View::addNamespace('Hourglass.Backend', base_path('hourglass/resources/views'));
 }
开发者ID:hourglass,项目名称:board,代码行数:4,代码来源:ApplicationServiceProvider.php

示例15: boot

 public function boot(Router $router)
 {
     Lang::addNamespace('_GHBaseComponent', __DIR__ . '/../../resources/lang');
     View::addNamespace('_GHBaseComponent', __DIR__ . '/../../resources/views');
     parent::boot($router);
 }
开发者ID:girolando,项目名称:base-component,代码行数:6,代码来源:BaseComponentProvider.php


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