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


PHP View::composer方法代码示例

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


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

示例1: postUser

 public function postUser()
 {
     $datosLogin = (array) Input::get('datosLogin');
     $rules = array('username' => 'required', 'password' => 'required|min:6');
     $validator = Validator::make($datosLogin, $rules);
     if ($validator->fails()) {
         return Redirect::back()->with('modal-id', 'formModal')->with('error_login_validation', $validator->messages())->with('alert-class', 'alert-danger');
     } else {
         $data = array('username' => $datosLogin['username'], 'password' => $datosLogin['password']);
         if (Auth::attempt($data, Input::get('remember_token', 0))) {
             if (Auth::check() && Auth::user()->estadoUsuario == 1) {
                 return Redirect::back()->with(compact(Auth::user()->with('personas.direcciones', 'tipousuarios')->get()))->with('mensajes', 'Bienvenid@ de vuelta:');
                 View::composer('vistas.user.profile', 'vistas.libro.show', 'templates.template', function ($view) {
                     $view->with(compact(Auth::user()->with('personas.direcciones', 'tipousuarios')->get()));
                 });
             } else {
                 Session::flush();
                 Cookie::forget('laravel_session');
                 Auth::logout();
                 return Redirect::to('/')->with('modal-id', 'formModal')->with('error_login', 'nombre de usuario, correo y/o contraseña no son los correctos')->with('alert-class', 'alert-danger');
             }
         }
         Session::flush();
         Cookie::forget('laravel_session');
         Auth::logout();
         return Redirect::to('/')->with('modal-id', 'formModal')->with('error_login', 'nombre de usuario, correo y/o contraseña no son los correctos')->with('alert-class', 'alert-danger');
     }
 }
开发者ID:chuckrincon,项目名称:shareon,代码行数:28,代码来源:LoginController.php

示例2: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     //
     \View::composer('*', function ($view) {
         $view->with('user', \Auth::user());
     });
 }
开发者ID:stiwarih,项目名称:p4,代码行数:12,代码来源:ComposerUserProvider.php

示例3: composePaket

 private function composePaket()
 {
     \View::composer(['frontend.app'], function ($view) {
         $pakets = Paket::all();
         $view->with(['pakets' => $pakets]);
     });
 }
开发者ID:satriashp,项目名称:tour,代码行数:7,代码来源:ViewComposerServiceProvider.php

示例4: _dbSyntax

 private function _dbSyntax($record_type, $from, $to)
 {
     $r_tas = $this->tableName[$record_type];
     if ($record_type === 'sales') {
         $dbResult = $r_tas['table']::with(['salelogs' => function ($sl) {
             $sl->with(['product' => function ($q) {
                 $q->with(array('categories' => function ($qr) {
                     $qr->select('id', 'type');
                 }))->select('id', 'name', 'productcat_id');
             }, 'customer' => function ($q) {
                 $q->select('id', 'name');
             }]);
         }])->whereBetween($r_tas['field'], array($from, $to))->orderBy('created_at', 'desc');
         $m = $dbResult;
         $totalAmount = $m->sum('amount_tendered');
         View::composer('admin.records.records_sales', function ($view) use($totalAmount) {
             $view->with('sumAmountTendered', $totalAmount);
             //$view->with('sumAmountDue', $m->sum('salelogs.total_unitprice'));
         });
         //tt( $m->sum('amount_tendered') );
         return $m->paginate($r_tas['paginate']);
     } else {
         return $r_tas['table']::whereBetween($r_tas['field'], array($from, $to))->get()->toArray();
     }
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:25,代码来源:AdminRecordsController.php

示例5: boot

 public function boot()
 {
     \View::composer('*', function ($view) {
         $guest = \App\User::find(0);
         $view->with('logged_in_user', \Auth::check() ? \Auth::user() : $guest);
     });
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:7,代码来源:ViewServiceProvider.php

示例6: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     \View::composer('*', function ($view) {
         $allCourses = \App\Course::with('requirements')->orderBy('course_name', 'ASC')->get()->toArray();
         $view->with('user', \Auth::user())->with('allCourses', $allCourses);
     });
 }
开发者ID:dnvmbr,项目名称:p4,代码行数:12,代码来源:ComposerServiceProvider.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     \View::composer('*', function ($view) {
         $view->with('angular_template_base_path', '/angular/templates?tmp=');
     });
 }
开发者ID:rbmowatt,项目名称:alohalbi.surf,代码行数:7,代码来源:SiteController.php

示例8: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     # Make the variable "user" available to all views
     \View::composer('*', function ($view) {
         $view->with('user', \Auth::user());
     });
 }
开发者ID:frankbaldwin,项目名称:P4,代码行数:12,代码来源:ComposerServiceProvider.php

示例9: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     // what needs to happen in the service Providers
     // make user available in all views
     \View::composer('*', function ($view) {
         $view->with('user', \Auth::user());
     });
 }
开发者ID:rhsu0268,项目名称:foobooks,代码行数:13,代码来源:ComposerServiceProvider.php

示例10: testLogin

 public function testLogin()
 {
     $this->call('GET', 'auth/login');
     $this->assertResponseOk();
     \View::composer('auth.login', function ($view) {
         $this->assertArrayHasKey('login_url', $view->getData());
     });
 }
开发者ID:k-kurikuri,项目名称:Laravel.JpRecipe,代码行数:8,代码来源:AuthenticateControllerTest.php

示例11: boot

 /**
  * Bootstrap any application services.
  *
  * @param \Illuminate\Bus\Dispatcher $dispatcher
  */
 public function boot(Dispatcher $dispatcher)
 {
     // Add export form to project sidebar
     \View::composer('layouts/sidebar/project', function (View $view) {
         $exportForm = new ExportIssues();
         $exportForm->setup(['project' => $view->project]);
         $view->with('exportForm', $exportForm);
     });
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:14,代码来源:ComposerServiceProvider.php

示例12: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     # Make the variable "user" available to all views
     \View::composer('*', function ($view) {
         $view->with('user', \Auth::user());
     });
     view()->composer('home', 'teambernieny\\Http\\ViewComposers\\HomeComposer');
     view()->composer('adminhome', 'teambernieny\\Http\\ViewComposers\\AdminHomeComposer');
 }
开发者ID:teambernieny,项目名称:teambernieny,代码行数:14,代码来源:ComposerServiceProvider.php

示例13: __construct

 public function __construct()
 {
     if (Request::ajax()) {
         $this->layout = 'backend.ajax_layout';
     }
     View::composer('backend.estructuras.layout', function ($view) {
         $data['encabezados'] = EstructuraEncabezado::with('categoria')->get();
         $view->nest('sidebar', 'backend.estructuras.list', $data);
     });
 }
开发者ID:e-gob,项目名称:api-instituciones-v2,代码行数:10,代码来源:EstructurasController.php

示例14: __construct

 public function __construct()
 {
     if (Request::ajax()) {
         $this->layout = 'backend.ajax_layout';
         View::share('fullmodal', Input::get('fullmodal', false));
     }
     View::composer('backend.instituciones.layout', function ($view) {
         $data['instituciones'] = Instituciones::maestras();
         $view->nest('sidebar', 'backend.instituciones.list', $data);
     });
 }
开发者ID:e-gob,项目名称:api-instituciones-v2,代码行数:11,代码来源:InstitucionesController.php

示例15: __construct

 public function __construct(CustomFields $customFieldsMangaer)
 {
     $this->customFieldsMangaer = $customFieldsMangaer;
     if (Request::ajax()) {
         $this->layout = 'backend.ajax_layout';
     }
     View::composer('backend.camposextra.layout', function ($view) {
         $data['camposextra'] = CustomField::all();
         $view->nest('sidebar', 'backend.camposextra.list', $data);
     });
 }
开发者ID:e-gob,项目名称:api-instituciones-v2,代码行数:11,代码来源:CamposExtraController.php


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