php Illuminate-View-View类(方法)实例源码

下面列出了php Illuminate-View-View 类(方法)源码代码实例,从而了解它的用法。

作者:aguila30    项目:oficio   
public function compose(View $view)
 {
     $documentForm = \Request::only('responsable_id');
     $route = Route::currentRouteName();
     $users = User::orderBy('name', 'ASC')->lists('name', 'id')->toArray();
     $view->with(compact('documentForm', 'users', 'route'));
 }

作者:digitlimi    项目:adminpane   
/**
  * 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());
     }
 }

作者:drickferreir    项目:rastreado   
/**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $path = $view->getPath();
     if (!is_object($path)) {
         if ($path) {
             $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
         }
         if (substr($path, -10) == '.blade.php') {
             $type = 'blade';
         } else {
             $type = pathinfo($path, PATHINFO_EXTENSION);
         }
     } else {
         $type = get_class($view);
         $path = '';
     }
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             $data[$key] = $this->exporter->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }

作者:redkniti    项目:maintenanc   
/**
  * 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);
 }

作者:ilkiniu    项目:btec.de   
public function compose(View $view)
 {
     $mainMenu = $this->pages->with('translation')->whereHas('menuPositions', function ($query) {
         $query->where('id', 2);
     })->get()->toHierarchy();
     $view->with('mainMenu', $mainMenu);
 }

作者:woolensculptur    项目:puls   
/**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if ($this->djs == null) {
         $this->djs = DJ::orderBy('name', 'asc')->get();
     }
     $view->with('djs', $this->djs);
 }

作者:SmoothPh    项目:laravel-debugba   
/**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $path = $view->getPath();
     if ($path) {
         $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
     }
     if (substr($path, -10) == '.blade.php') {
         $type = 'blade';
     } else {
         $type = pathinfo($path, PATHINFO_EXTENSION);
     }
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (in_array($key, ['__env', 'app', 'errors', 'obLevel', 'currentUser'])) {
                 continue;
             }
             $data[$key] = $this->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }

作者:mage    项目:laravel-ecommerc   
/**
  * 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);
 }

作者:paul-schuller    项目:laravel-googletagmanage   
/**
  * Bind data to the view.
  *
  * @param View $view
  */
 public function create(View $view)
 {
     if ($this->googleTagManager->isEnabled() && empty($this->googleTagManager->id())) {
         throw new ApiKeyNotSetException();
     }
     $view->with('enabled', $this->googleTagManager->isEnabled())->with('id', $this->googleTagManager->id())->with('dataLayer', $this->googleTagManager->getDataLayer());
 }

作者:mage    项目:laravel-ecommerc   
/**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $productAttrobuteModel = new ProductAttribute();
     $isFeaturedOptions = $productAttrobuteModel->getIsFeaturedOptions();
     $statusOptions = $productAttrobuteModel->getStatusOptions();
     $view->with('isFeaturedOptions', $isFeaturedOptions)->with('statusOptions', $statusOptions);
 }

作者:eddiePowe    项目:laravelSite   
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);
 }

作者:gitfreenger    项目:laru   
/**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $user = $this->user->find($this->user_auth->id);
     $notifications = $user->notifications()->noread()->get();
     $notificationsCount = $notifications->count();
     $view->with(['notifications' => $notifications, 'notificationsCount' => $notificationsCount]);
 }

作者:jespersgaar    项目:tylo   
/**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $user = Cache::remember('user', 1440, function () {
         return Auth::user();
     });
     $view->with('user', $user);
 }

作者:kevindierk    项目:uuid-namespace-manage   
/**
  * Set the content for the reponse.
  *
  * @return \Illuminate\View\View
  */
 public function setContent($view, $data = [])
 {
     if (!is_null($this->layout)) {
         return $this->layout->nest('content', $view, $data);
     }
     return view($view, $data);
 }

作者:woolensculptur    项目:puls   
/**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if ($this->shows == null) {
         $this->shows = Show::orderBy('name', 'asc')->get();
     }
     $view->with('shows', $this->shows);
 }

作者:marvinlab    项目:baoba   
/**
  * Use this in your templates to render views returned by the controllers
  *
  * @param \Illuminate\View\View $view The view to be rendered
  */
 public static function render($view)
 {
     try {
         echo $view->render();
     } catch (\Exception $e) {
         echo $e->getMessage();
     }
 }

作者:ipunk    项目:laravel-notif   
/**
  * composing the view
  *
  * @param \Illuminate\View\View $view
  */
 public function compose(\Illuminate\View\View $view)
 {
     $notifications = [];
     if (null !== ($user = $this->authManager->user())) {
         $notifications = $this->notificationManager->getForUser($user, [NotificationActivity::CREATED, NotificationActivity::READ]);
     }
     $view->with('notifications', $notifications);
 }

作者:chyup    项目:Beta-Barok   
public function compose(View $view)
 {
     $sessionId = session()->getId();
     $sessionCartItems = $this->sessionCartRepo->getCartItemsNumber($sessionId);
     $sessionCart = $this->sessionCartRepo->getCartBySessionId($sessionId);
     $totals = $this->sessionCartRepo->calculateTotalBySessionId($sessionCart);
     $view->with('cart_items_number', $sessionCartItems)->with('cart_items_transport_fee', $totals['transportFee'])->with('cart_items_total', $totals['total']);
 }

作者:josev    项目:timegri   
/**
  * Bind data to the view.
  *
  * @param View $view
  *
  * @return void
  */
 public function compose(View $view)
 {
     $locale = app()->getLocale();
     $filename = Request::route()->getName() . '.md';
     $filepath = 'userhelp' . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . $filename;
     $help = Storage::exists($filepath) ? Markdown::convertToHtml(Storage::get($filepath)) : '';
     $view->with('help', $help);
 }

作者:mage    项目:laravel-ecommerc   
/**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $productAttrobuteModel = new ProductAttribute();
     $trackStockOptions = $productAttrobuteModel->getTrackStockOptions();
     $inStockOptions = $productAttrobuteModel->getInStockOptions();
     $isTaxableOptions = $productAttrobuteModel->getIsTaxableOptions();
     $view->with('isTaxableOptions', $isTaxableOptions)->with('trackStockOptions', $trackStockOptions)->with('inStockOptions', $inStockOptions);
 }


问题


面经


文章

微信
公众号

扫码关注公众号