當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。