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


PHP View::with方法代码示例

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


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

示例1: compose

 /**
  * Bind data to the view.
  *
  * @param View $view
  *
  * @return void
  */
 public function compose(View $view)
 {
     $data = $view->getData();
     if (Auth::check()) {
         $notifications = Auth::user()->notifications()->with('user')->orderBy('created_at', 'desc')->take(15)->get();
         $view->with('notifications', $notifications);
         $unreadCount = Auth::user()->notifications()->wherePivot('read', false)->count();
         $view->with('newNotificationsCount', $unreadCount);
     }
     // Get object from which we can extract name to use as page title
     $currentGroup = head(array_only($data, ['group', 'folder', 'fakeGroup']));
     $view->with('currentGroup', $currentGroup);
     if (isset($currentGroup) && isset($currentGroup->name)) {
         $pageTitle = $currentGroup->name;
         // Homepage title shall always be Strimoid.pl
         if ($currentGroup->urlname == 'all' && !Setting::get('homepage_subscribed', false)) {
             $pageTitle = 'Strimoid';
         }
         if ($currentGroup->urlname == 'subscribed' && Setting::get('homepage_subscribed', false)) {
             $pageTitle = 'Strimoid';
         }
     } else {
         $pageTitle = 'Strimoid';
     }
     $view->with('pageTitle', $pageTitle);
     // Needed by top bar with groups
     $popularGroups = Cache::remember('popularGroups', 60, function () {
         return Group::orderBy('subscribers_count', 'desc', true)->take(30)->get(['id', 'name', 'urlname']);
     });
     $view->with('popularGroups', $popularGroups);
 }
开发者ID:vegax87,项目名称:Strimoid,代码行数:38,代码来源:MasterComposer.php

示例2: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('disposition_check', ['use as is', 'ncmr#', 'rework', 'split lot', 'shutdown', 'shipback']);
     $view->with('cod_check', ['production', 'process', 'maintenance', 'facilities', 'quality assurance', 'others']);
     $view->with('approvers', ['production', 'process', 'quality assurance', 'others']);
     $view->with('names', Employee::select('name')->orderBy('name')->where('name', '<>', Auth::User()->employee->name)->get());
 }
开发者ID:rob1121,项目名称:qdn,代码行数:13,代码来源:RecordUpdateComposer.php

示例3: compose

 /**
  * Composer for showing a user
  *
  * @param View $view
  */
 public function compose(View $view)
 {
     $user = $view->getData()['user'];
     $view->with('user_courses', \User::userCoursesPaginate($user));
     $view->with('user_courses_count', \User::countUserCourses($user));
     $view->with('count_followers', \User::countFollowers($user));
 }
开发者ID:bohap,项目名称:online-study,代码行数:12,代码来源:ShowUserComposer.php

示例4: compose

 public function compose(View $view)
 {
     $categories = \App\Models\Categories::i()->withPostsCount();
     $posts_count = \App\Models\Posts::active()->count();
     $view->with('categories', $categories);
     $view->with('posts_count', $posts_count);
 }
开发者ID:vitos8686,项目名称:0ez,代码行数:7,代码来源:CategoriesMenuComposer.php

示例5: compose

 /**
  * Composer for the main navigation
  *
  * @param View $view
  */
 public function compose(View $view)
 {
     $view->with('logged_in', \Auth::check());
     if (\Auth::check()) {
         $view->with('logged_user', \Auth::user());
     }
 }
开发者ID:bohap,项目名称:online-study,代码行数:12,代码来源:NavigationComposer.php

示例6: compose

 /**
  * Bind data to the view.
  *
  * @param  View $view
  *
  * @return void
  */
 public function compose(View $view)
 {
     $summary = $this->getCharacterInformation($this->request->character_id);
     $characters = $this->getCharactersOnApiKey($summary->keyID);
     $view->with('summary', $summary);
     $view->with('characters', $characters);
 }
开发者ID:eveseat,项目名称:web,代码行数:14,代码来源:CharacterSummary.php

示例7: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('heder', view('admin.header'));
     $tables = new Cms_tables();
     $activeTable = $tables->getActiveTables();
     $view->with('left_column', view('admin.left_colum', ['tables' => $activeTable]));
 }
开发者ID:nilBora,项目名称:sandbox_laravel,代码行数:13,代码来源:AdminComposer.php

示例8: compose

 public function compose(View $view)
 {
     $this->post = $view->offsetGet('post');
     $embedHtml = $this->getEmebdHtml();
     $previousVoteValue = $this->getPreviousVoteValue();
     $view->with('previousVoteValue', $previousVoteValue);
     $view->with('embedHtml', $embedHtml);
 }
开发者ID:ntzm,项目名称:laravit,代码行数:8,代码来源:PostComposer.php

示例9: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $network_id = config('yppmembers.network_id');
     $network = Network::find($network_id);
     $page_title = $network->name;
     $view->with('network', $network);
     $view->with('support_url', config('yppmembers.support_url'));
 }
开发者ID:kirtromero,项目名称:cw_members,代码行数:14,代码来源:BaseComposer.php

示例10: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     // If you want the wiki post dropown menu to show, this $post is required.
     $post = Mrcore::post()->prepare();
     $view->with('post', $post);
     $view->with('navTitle', 'Navigation');
     $view->with('navItems', array(['key' => 'dashboard', 'display' => 'Dashboard'], ['key' => 'menuitem1', 'display' => 'MenuItem 1', 'url' => ''], ['key' => 'menuitem2', 'display' => 'MenuItem 2', 'subnav' => array(['key' => 'submenuitem1', 'display' => 'Sub MenuItem 1', 'url' => ''], ['key' => 'submenuitem2', 'display' => 'Sub MenuItem 2', 'url' => ''])]));
 }
开发者ID:jplata,项目名称:mrcore-appstub,代码行数:14,代码来源:ViewComposer.php

示例11: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('select_failure_mode', ['Assembly', 'Environment', 'Machine', 'Man', 'Material', 'Method / Process']);
     $view->with('customers', Option::orderBy('customer')->select('customer')->get());
     $view->with('machines', Machine::orderBy('name')->select('name')->get());
     $view->with('stations', Station::select('station')->get());
     $view->with('employees', Employee::orderBy('name')->select('name')->where('name', '<>', Auth::user()->employee->name)->get());
 }
开发者ID:rob1121,项目名称:qdn,代码行数:14,代码来源:FormOptionComposer.php

示例12: compose

 /**
  * Generates the pending and deploying projects for the view.
  *
  * @param  \Illuminate\Contracts\View\View $view
  * @return void
  */
 public function compose(View $view)
 {
     $pending = $this->deploymentRepository->getPending();
     $view->with('pending', $pending);
     $view->with('pending_count', count($pending));
     $deploying = $this->deploymentRepository->getRunning();
     $view->with('deploying', $deploying);
     $view->with('deploying_count', count($deploying));
 }
开发者ID:arasmit2453,项目名称:deployer,代码行数:15,代码来源:HeaderComposer.php

示例13: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $user = Auth::user();
     if (!empty($user)) {
         $view->with('user', $user->getValues());
     } else {
         $view->with('user', []);
     }
 }
开发者ID:weopendata,项目名称:medea,代码行数:15,代码来源:MainComposer.php

示例14: compose

 public function compose(View $view)
 {
     $view->with('websiteTitle', app('typicms')->title());
     $navbar = false;
     if (auth()->user() && (auth()->user()->hasAnyRole(['administrator', 'editor']) || auth()->user()->isSuperUser()) && !request()->input('preview')) {
         $navbar = true;
     }
     $view->with('navbar', $navbar);
 }
开发者ID:webfactorybulgaria,项目名称:Core,代码行数:9,代码来源:MasterViewComposer.php

示例15: compose

 public function compose(View $view)
 {
     $setting = Setting::orderBy('created_at', 'DESC')->first();
     if (!is_null($setting)) {
         $view->with('app_title', $setting->name);
     } else {
         $view->with('app_title', 'Default App Title');
     }
 }
开发者ID:buonzz-systems,项目名称:gander,代码行数:9,代码来源:SettingComposer.php


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