本文整理汇总了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');
}
}
示例2: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
\View::composer('*', function ($view) {
$view->with('user', \Auth::user());
});
}
示例3: composePaket
private function composePaket()
{
\View::composer(['frontend.app'], function ($view) {
$pakets = Paket::all();
$view->with(['pakets' => $pakets]);
});
}
示例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();
}
}
示例5: boot
public function boot()
{
\View::composer('*', function ($view) {
$guest = \App\User::find(0);
$view->with('logged_in_user', \Auth::check() ? \Auth::user() : $guest);
});
}
示例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);
});
}
示例7: __construct
public function __construct()
{
parent::__construct();
\View::composer('*', function ($view) {
$view->with('angular_template_base_path', '/angular/templates?tmp=');
});
}
示例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());
});
}
示例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());
});
}
示例10: testLogin
public function testLogin()
{
$this->call('GET', 'auth/login');
$this->assertResponseOk();
\View::composer('auth.login', function ($view) {
$this->assertArrayHasKey('login_url', $view->getData());
});
}
示例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);
});
}
示例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');
}
示例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);
});
}
示例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);
});
}
示例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);
});
}