本文整理汇总了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';
}
示例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'));
}
示例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');
}
}
示例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);
}
示例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);
});
}
示例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();
}
示例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');
}
示例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}); ?>";
});
}
示例9: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
View::addNamespace('profile', __DIR__ . '/../../views');
}
示例10: __construct
public function __construct()
{
View::addNamespace('frontend', __DIR__ . '/../views');
}
示例11: __construct
public function __construct($currentPageObject)
{
$this->currentPageObject = $currentPageObject;
View::addNamespace('pageControls', __DIR__ . '/views');
}
示例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);
}
示例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'));
}
示例14: registerViews
protected function registerViews()
{
View::addNamespace('Hourglass.Backend', base_path('hourglass/resources/views'));
}
示例15: boot
public function boot(Router $router)
{
Lang::addNamespace('_GHBaseComponent', __DIR__ . '/../../resources/lang');
View::addNamespace('_GHBaseComponent', __DIR__ . '/../../resources/views');
parent::boot($router);
}