本文整理汇总了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);
}
示例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());
}
示例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));
}
示例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);
}
示例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());
}
}
示例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);
}
示例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]));
}
示例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);
}
示例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'));
}
示例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' => ''])]));
}
示例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());
}
示例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));
}
示例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', []);
}
}
示例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);
}
示例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');
}
}