本文整理汇总了PHP中Illuminate\Support\Facades\View::composer方法的典型用法代码示例。如果您正苦于以下问题:PHP View::composer方法的具体用法?PHP View::composer怎么用?PHP View::composer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\View
的用法示例。
在下文中一共展示了View::composer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerConfig();
$this->registerTranslations();
$this->registerViews();
View::composer(['partials.header'], 'Modules\\Notifications\\Http\\ViewComposers\\NotificationComposer');
}
示例2: shareFis
protected function shareFis()
{
$fis = $this->app->make('fis');
View::composer('*', function ($view) use($fis) {
$view->with('__fis', $fis);
});
}
示例3: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
View::composer('*', function ($view) {
$view->with('currentUser', Auth::user());
$view->with('signedIn', Auth::user());
});
}
示例4: setupLayout
protected function setupLayout()
{
$is_rapyd = (Request::server('HTTP_HOST') == "www.rapyd.com") ? true : false;
View::composer('rapyd::demo.*', function ($view) use ($is_rapyd) {
$view->with('is_rapyd', $is_rapyd);
});
}
示例5: __construct
public function __construct()
{
//$this->beforeFilter(function(){ });
$this->uriSegment = null;
$this->modelName = null;
$this->viewsPath = null;
$this->resourceId = null;
if (Route::input('alias') !== null) {
$this->uriSegment = Route::input('alias');
$this->viewsPath = File::exists(app_path('views/' . Config::get('reactiveadmin::uri') . '/' . $this->uriSegment)) ? Config::get('reactiveadmin::uri') . '.' . $this->uriSegment : 'reactiveadmin::default';
$this->modelName = studly_case(str_singular(Route::input('alias')));
$this->modelWrapper = App::make('model_wrapper');
$this->modelWrapper->model($this->modelName);
if (Route::input('id') !== null) {
$this->resourceId = Route::input('id');
}
View::share('config', $this->modelWrapper->getConfig());
// TODO: refactor this!
// custom behavior
switch ($this->uriSegment) {
case 'settings':
View::composer(array('admin.' . $this->viewsPath . '.index'), function ($view) {
$view->with('settings', Settings::all());
});
break;
default:
# code...
break;
}
}
View::share('view', $this->uriSegment);
View::share('model', $this->modelName);
}
示例6: setWidgetComposer
private function setWidgetComposer($widget)
{
View::composer('dashboard.dashboard', function ($view) use($widget) {
$view->with('widget', $widget);
});
return $this;
}
示例7: register
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind('App\\Lambda\\Repositories\\LambdaRepositoryInterface', 'App\\Lambda\\Repositories\\LambdaRepository');
// $this->app->bind('App\Lambda\Billing\BillingInterface', 'App\Lambda\Billing\StripeBilling');
View::composer('partials.sidebar', 'App\\Lambda\\Composers\\SidebarComposer');
View::composer(['partials.admin-sidebar', 'dashboard/*'], 'App\\Lambda\\Composers\\AccountSidebarComposer');
View::composer(['partials.nav', 'errors/404'], 'App\\Lambda\\Composers\\NavComposer');
}
示例8: boot
/**
* @return void
*/
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../../views', 'yandex-kassa');
$this->publishes([__DIR__ . '/../../config/yandex_kassa.php' => config_path('yandex_kassa.php')]);
$this->publishes([__DIR__ . '/../../database/migrations/' => database_path('/migrations/yandex_kassa')], 'migrations');
include __DIR__ . '/../routes.php';
View::composer(config('yandex_kassa.form_view'), SettingsComposer::class);
}
示例9: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
View::composer('backend.left-sidebar', function ($view) {
$menuItems = new MenuItems();
$menuItems = $menuItems->generate();
$view->with(compact('menuItems'));
});
}
示例10: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
View::composer(array('welcome', 'profile.profile', 'partials.head_profile', 'calc.index'), 'App\\Composers\\UserComposer');
View::composer(['profile.profile', 'request.create', 'partials.head_profile', 'calc.index'], 'App\\Composers\\PercentComposer');
View::composer(['profile.profile', 'request.create', 'partials.head_profile', 'calc.index'], 'App\\Composers\\CourseComposer');
View::composer('request.create', 'App\\Composers\\DaysComposer');
View::composer('layouts.profile_layout', 'App\\Composers\\ProfileComposer');
View::composer(['profile.profile', 'welcome'], 'App\\Composers\\PlansComposer');
}
示例11: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
View::composer('welcome', 'App\\View\\Composers\\AdvComposer');
View::composer(['favorites.index', 'ads.my', 'home'], 'App\\View\\Composers\\AdvComposer');
View::composer('slider.slider', 'App\\View\\Composers\\CategoryComposer');
View::composer('slider.slider', 'App\\View\\Composers\\CityComposer');
View::composer('slider.slider', 'App\\View\\Composers\\TypeComposer');
View::composer('slider.slide', 'App\\View\\Composers\\SliderComposer');
}
示例12: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
View::composer(['front.includes.header'], function ($view) {
$model = new Category();
$categories = $model->getCategoryTree();
$view->with('categories', $categories);
});
}
示例13: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
/**
* recibe 2 parametros
* 1. la vista o las vistas.
* 2. Namespace del view composer
*/
View::composer(['front.index', 'front.article', 'front.content'], 'App\\Http\\ViewComposers\\AsideComposer');
}
示例14: boot
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
// custom namespace
$this->package('alexwenzel/laravel-commentary', 'laravel-commentary');
// comment list composer
View::composer('laravel-commentary::comment-list', function ($view) {
$entity = $view->entity;
$comments = Comment::where('entity', $entity)->where('status', Comment::statusApproved)->orderBy('created_at', 'desc')->get();
$view->with('comments', $comments);
});
}
示例15: boot
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
View::composer('nav', 'App\\Composers\\ViewComposer@navigation');
View::composer('modules.latest-musics', 'App\\Composers\\ViewComposer@latestMusicsModule');
View::composer('modules.latest-videos', 'App\\Composers\\ViewComposer@latestVideosModule');
View::composer('modules.latest-users', 'App\\Composers\\ViewComposer@latestUsersModule');
View::composer('modules.top-musics', 'App\\Composers\\ViewComposer@topMusicsModule');
View::composer('modules.top-videos', 'App\\Composers\\ViewComposer@topVideosModule');
View::composer('modules.top-users', 'App\\Composers\\ViewComposer@topUsersModule');
View::composer('cats.list-cats', 'App\\Composers\\ViewComposer@catModule');
}