当前位置: 首页>>代码示例>>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;未经允许,请勿转载。