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


PHP View::with方法代码示例

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


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

示例1: compose

 /**
  * Applies site wide variables to main layout.
  *
  * @param $view
  */
 public function compose(View $view)
 {
     $siteTitle = $this->config->get('site.title.main');
     $currentUser = $this->sentry->getCurrentUser();
     $view->with('siteTitle', $siteTitle);
     $view->with('currentUser', $currentUser);
 }
开发者ID:redknitin,项目名称:maintenance,代码行数:12,代码来源:MainLayoutComposer.php

示例2: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if ($this->auth->check()) {
         $view->with('auth', $this->user);
         $view->with('dashboard', $this->dashboardService->dashboard());
     }
 }
开发者ID:digitlimit,项目名称:adminpanel,代码行数:13,代码来源:AdminpanelDashboardComposer.php

示例3: compose

 /**
  * @param View $view
  */
 public function compose(View $view)
 {
     $view->with('currentUser', $this->sentinel->getUser());
     $view->with('mode', array_get($view->getData(), 'mode', ''));
     $view->with('breadcrumbs', config('shapeshifter.breadcrumbs') ? $this->breadcrumbService->breadcrumbs() : []);
     $view->with('menu', $this->menuService->generateMenu());
 }
开发者ID:wearejust,项目名称:shapeshifter,代码行数:10,代码来源:Layout.php

示例4: compose

 /**
  * Bind data to the view.
  *
  * @param  View $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('productsCount', $this->getProductsCount());
     $view->with('usersCount', $this->getUsersCount());
     $view->with('subscribersCount', $this->getSubscribersCount(app(SubscribersCache::class)));
     $view->with('visitors', $this->getUniqueVisitorsCount());
     $view->with('dashboardGraph', $this->getDashboardGraph());
 }
开发者ID:mmonbr,项目名称:20Pavos,代码行数:14,代码来源:Dashboard.php

示例5: callAction

 /**
  * Execute an action on the controller.
  *
  * @param  string  $method
  * @param  array   $parameters
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function callAction($method, $parameters)
 {
     $this->setupLayout();
     $response = call_user_func_array(array($this, $method), $parameters);
     if ($response instanceof View && !$this->layout->offsetExists('content')) {
         return $this->layout->with('content', $response);
     }
     return $response;
 }
开发者ID:kevindierkx,项目名称:muse,代码行数:16,代码来源:AbstractController.php

示例6: addViewDefaults

 /**
  * @param \Illuminate\View\View $view
  */
 protected function addViewDefaults(\Illuminate\View\View $view)
 {
     if ($title = $view->title) {
         $title .= ' – ';
     }
     $title .= $this->admin->title;
     $view->with('pageTitle', $title);
     $view->with('adminTitle', $this->admin->title);
 }
开发者ID:GlobalsDD,项目名称:admin,代码行数:12,代码来源:BaseController.php

示例7: compose

 /**
  * @param $view
  */
 public function compose(View $view)
 {
     $viewData = $view->getData();
     $date = array_has($viewData, 'date') && $viewData['date'] ? $viewData['date'] : Carbon::today();
     $calendar = $this->manager->getCalendar(Carbon::today());
     $lastBillboard = $this->billboardsRepository->findNewer();
     $view->with('calendar', $calendar);
     $view->with('date', $date);
     $view->with('lastBillboard', $lastBillboard);
 }
开发者ID:filmoteca,项目名称:filmoteca,代码行数:13,代码来源:ExhibitionComposer.php

示例8: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $tasks = $this->tasks->find($view->getData()['tasks']['id']);
     /**
      * [User assigned the task]
      * @var contact
      */
     $contact = $tasks->assignee;
     $client = $tasks->clientAssignee;
     $view->with('contact', $contact);
     $view->with('client', $client);
 }
开发者ID:Bottelet,项目名称:Flarepoint-crm,代码行数:18,代码来源:TaskHeaderComposer.php

示例9: compose

 /**
  * Compose the View
  *
  * @param View $view
  *
  * @return mixed
  */
 public function compose(View $view)
 {
     // check if any args to be provided by extending classes are provided
     $this->checkArguments();
     $key = h($this->outputVariable);
     if ($this->cache->has($key)) {
         $view->with($this->outputVariable, $this->cache->get($key));
     } else {
         $data = $this->getData();
         $this->cache->put($key, $data);
         $view->with($this->outputVariable, $data);
     }
 }
开发者ID:muhamadsyahril,项目名称:ecommerce-1,代码行数:20,代码来源:ViewComposer.php

示例10: compose

 public function compose(View $view)
 {
     if (self::$cart) {
         $view->with('cart', self::$cart);
         return;
     }
     $cart = [];
     if (Auth::check()) {
         $items = app(CartManager::class)->getItemsForUserGroupedBySeller(Auth::user());
         $cart = ['count' => $items->totalCount(), 'items' => $items];
     }
     $view->with('cart', self::$cart = $cart);
 }
开发者ID:gez-studio,项目名称:gez-mall,代码行数:13,代码来源:CartViewComposer.php

示例11: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $client = new Client();
     try {
         $response = $client->get('http://logger.witr.rit.edu/latest.json', ['timeout' => 1]);
         return $view->with('nowplaying', $response->json(['object' => true]));
     } catch (RequestException $e) {
         $data = new stdClass();
         $data->artist = '';
         $data->title = 'Not Available';
         return $view->with('nowplaying', $data);
     }
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:19,代码来源:NowPlayingViewComposer.php

示例12: address

 /**
  * @param View $view
  */
 public function address($view)
 {
     $viewData = $view->getData();
     $address = ['id' => '', 'address1' => '', 'address2' => '', 'address3' => '', 'city' => '', 'state' => '', 'postcode' => '', 'countryId' => ''];
     if (isset($viewData['address']) && $viewData['address']) {
         foreach ($viewData['address'] as $key => $value) {
             $address[$key] = $value;
         }
     }
     $view->with('address', $address);
     if (!isset($viewData['prefix'])) {
         $view->with('prefix', '');
     }
 }
开发者ID:alistairshaw,项目名称:vendirun-plugin,代码行数:17,代码来源:CustomerViewComposer.php

示例13: compose

 public function compose(View $view)
 {
     $mainMenu = $this->pages->with('translation')->whereHas('menuPositions', function ($query) {
         $query->where('id', 2);
     })->get()->toHierarchy();
     $view->with('mainMenu', $mainMenu);
 }
开发者ID:ilkinium,项目名称:btec.dev,代码行数:7,代码来源:NavigationComposer.php

示例14: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $cart = count(Session::get('cart'));
     $categoryModel = new Category();
     $baseCategories = $categoryModel->getAllCategories();
     $view->with('categories', $baseCategories)->with('cart', $cart);
 }
开发者ID:mage2,项目名称:laravel-ecommerce,代码行数:13,代码来源:LayoutAppComposer.php

示例15: prepare

 public function prepare(View $view, array $parameters)
 {
     //dd($parameters);
     //grab the single post that match's the id in the parameters or routing data sent
     $post = $this->posts->where('id', $parameters['id'])->where('slug', $parameters['slug'])->first();
     $view->with('post', $post);
 }
开发者ID:eddiePower,项目名称:laravelSites,代码行数:7,代码来源:BlogPostTemplate.php


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