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