當前位置: 首頁>>代碼示例>>PHP>>正文


PHP View\View類代碼示例

本文整理匯總了PHP中Illuminate\Contracts\View\View的典型用法代碼示例。如果您正苦於以下問題:PHP View類的具體用法?PHP View怎麽用?PHP View使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了View類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     // Retrieve all categories
     $categories = Category::all();
     // Bind them to view
     $view->with('categories', $categories);
 }
開發者ID:Erbenos,項目名稱:laravel-blog,代碼行數:13,代碼來源:CategoryComposer.php

示例2: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $empresaslista = Empresa::orderBy('nombre', 'ASC')->lists('nombre', 'nombre');
     $localidades = Localidad::orderBy('nombre', 'ASC')->lists('nombre', 'id');
     $rubros = Rubro::orderBy('nombre', 'ASC')->lists('nombre', 'id');
     $view->with('rubros', json_decode($rubros, true))->with('empresaslista', json_decode($empresaslista, true))->with('localidades', json_decode($localidades, true));
 }
開發者ID:desarrollo-para-triunfadores,項目名稱:laautentica,代碼行數:13,代碼來源:EmpresaComposer.php

示例3: compose

 /**
  * Bind data to the view.
  *
  * @param \Illuminate\Contracts\View\View $view
  */
 public function compose(View $view)
 {
     $view->withIssueCount(Issue::all()->count());
     $view->withProjectCount(Project::all()->count());
     $view->withGroupCount(Group::count());
     $view->withMomentCount(Moment::all()->count());
 }
開發者ID:xiaobailc,項目名稱:Gitamin,代碼行數:12,代碼來源:DashboardComposer.php

示例4: compose

 public function compose(View $view)
 {
     if ($view->getName() == 'frontend.property.compare_bar') {
         $propertiesInComparison = PropertyCompareHelper::getCurrentList();
         $view->with('propertiesInComparison', $propertiesInComparison);
     }
 }
開發者ID:yohanes1989,項目名稱:goprop,代碼行數:7,代碼來源:PropertyComposer.php

示例5: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     //$notifacations = DB::table('notifacations')->where('userID', Auth::user()->id)->get();
     $notifacationsCount = DB::table('notifacations')->where('userID', Auth::user()->id)->count();
     //$view->with('notifacations', $notifacations);
     $view->with('notifacationsCount', $notifacationsCount);
 }
開發者ID:deferdie,項目名稱:tweet,代碼行數:13,代碼來源:ApplicationComposer.php

示例6: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if (!Cache::get('popular_categories')) {
         Cache::put('popular_categories', $this->categories->getPopular(), 60);
     }
     $view->with('popular_categories', Cache::get('popular_categories'));
 }
開發者ID:ambarsetyawan,項目名稱:brewski,代碼行數:13,代碼來源:PopularCategoriesComposer.php

示例7: compose

 /**
  * Bind data to the view.
  *
  * @param View $view
  * @return void
  */
 public function compose(View $view)
 {
     $menu = new Menu('ul', 'nav navbar-nav');
     $menu->addItem(new MenuItem('#page-top', trans('pages.home_title'), 'li', 'hidden', 'page-scroll'));
     $menu = content_filter('main_menu', $menu);
     $view->with('main_menu', $menu);
 }
開發者ID:linhntaim,項目名稱:katniss,代碼行數:13,代碼來源:MainMenuComposer.php

示例8: compose

 public function compose(View $view)
 {
     $categories = Cache::remember('categories', 1440, function () {
         return Category::orderBy('name')->get();
     });
     $view->with(['user' => $this->auth->user(), 'categories' => $categories, 'guest' => !$this->auth->check()]);
 }
開發者ID:net-shell,項目名稱:socialsync,代碼行數:7,代碼來源:ViewComposer.php

示例9: compose

 /**
  * Index page view composer.
  *
  * @param \Illuminate\Contracts\View\View $view
  *
  * @return void
  */
 public function compose(View $view)
 {
     $isEnabled = (bool) Setting::get('enable_subscribers', false);
     $mailAddress = env('MAIL_ADDRESS', false);
     $mailFrom = env('MAIL_NAME', false);
     $view->withSubscribersEnabled($isEnabled && $mailAddress && $mailFrom);
 }
開發者ID:practico,項目名稱:Cachet,代碼行數:14,代碼來源:AppComposer.php

示例10: create

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function create(View $view)
 {
     // request the Client translations
     $clients = [Lang::get('labels.enter.Client')] + $this->clientController->lists('Client_Name');
     //dd(__METHOD__."(".__LINE__.")",compact('clients'));
     $view->with('clients', $clients);
 }
開發者ID:pneal-vital,項目名稱:vital4.0,代碼行數:13,代碼來源:ClientCreator.php

示例11: create

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function create(View $view)
 {
     // request the UOM translations
     $uoms = [Lang::get('labels.enter.UOM')] + $this->uomController->translate('Uom');
     //dd(__METHOD__."(".__LINE__.")",compact('uoms'));
     $view->with('uoms', $uoms);
 }
開發者ID:pneal-vital,項目名稱:vital4.0,代碼行數:13,代碼來源:UOMCreator.php

示例12: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $productoslista = Producto::orderBy('nombre', 'ASC')->searchActivos()->lists('nombre', 'nombre');
     $marcas = Marca::orderBy('nombre', 'ASC')->searchActivos()->lists('nombre', 'id');
     $tipos = Tipoproducto::orderBy('nombreTipo', 'ASC')->lists('nombreTipo', 'id');
     $view->with('marcas', json_decode($marcas, true))->with('tipos', json_decode($tipos, true))->with('productoslista', json_decode($productoslista, true));
 }
開發者ID:desarrollo-para-triunfadores,項目名稱:laautentica,代碼行數:13,代碼來源:ProductoFrontComposer.php

示例13: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if (!Cache::get('recent_posts')) {
         Cache::put('recent_posts', $this->posts->getAll('published', null, 'published_at', 'desc', 5), 10);
     }
     $view->with('recent_posts', Cache::get('recent_posts'));
 }
開發者ID:ambarsetyawan,項目名稱:brewski,代碼行數:13,代碼來源:RecentPostsComposer.php

示例14: compose

 /**
  * Bind data to the view.
  *
  * @param  View $view
  *
  * @return void
  */
 public function compose(View $view)
 {
     if ($view->group_form_errors and $view->errors->any()) {
         $view->nest('form_error_content', $view->bsb_pkg_ref . '::form.control.errors', ['errors' => $view->errors->all()]);
     }
     foreach ($view->groups as $name => &$input) {
         if (is_array($input)) {
             if (count(array_filter(array_keys($input), 'is_string'))) {
                 //The array contains named keys, generate inputs from these options
                 $view_name = $view->bsb_pkg_ref . '::input.' . (empty($input['type']) ? 'text' : $input['type']);
                 if (!view()->exists($view_name)) {
                     $view_name = $view->bsb_pkg_ref . '::input.' . 'text';
                 }
                 $input = view($view_name, array_merge(compact('name'), $input), $view->getData());
             } else {
                 //The array contains html strings, display them together within a form-group
                 $input = view($view->bsb_pkg_ref . '::input.group', ['content' => implode("\n", $input)], $view->getData());
             }
         } elseif (!str_contains($input, '.form-group')) {
             //The input is just a string of html, but it doesn't contain any .form-group element, so we'll wrap it in one
             $input = view($view->bsb_pkg_ref . '::input.group', ['content' => $input], $view->getData());
         }
     }
     //TODO: add form-horizontal and form-inline options
 }
開發者ID:fewagency,項目名稱:twbs-blade,代碼行數:32,代碼來源:FormComposer.php

示例15: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $user = $this->user;
     $travelOrderCount = 0;
     $regularLeaveCount = 0;
     $specialLeaveCount = 0;
     if ($user->employee && $user->employee->canApproveRegularLeave()) {
         $regularLeaveCount = $user->employee->regular_leave_recommending_approvals->merge($user->employee->regular_leave_approved_by)->count();
     }
     if ($user->employee && $user->employee->canApproveSpecialLeave()) {
         $specialLeaveCount = $user->employee->special_leave_recommending_approvals->merge($user->employee->special_leave_approved_by)->count();
     }
     if ($user->isAdmin()) {
         $regularLeaveCount = EmployeeLeave::approved()->count();
         $specialLeaveCount = EmployeeSpecialLeave::approved()->count();
     }
     if ($user->employee && $user->employee->canApproveTravelOrder()) {
         if ($user->isFinanceDirector()) {
             $travelOrderCount = TravelOrder::recommended()->count();
         } else {
             $travelOrderCount = $user->employee->travel_order_recommending_approvals->merge($user->employee->travel_order_approved_by)->count();
         }
     }
     $view->with(compact('user', 'regularLeaveCount', 'specialLeaveCount', 'travelOrderCount'));
 }
開發者ID:rosemalejohn,項目名稱:dnsc-hris,代碼行數:31,代碼來源:SidebarComposer.php


注:本文中的Illuminate\Contracts\View\View類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。