本文整理汇总了PHP中view::share方法的典型用法代码示例。如果您正苦于以下问题:PHP view::share方法的具体用法?PHP view::share怎么用?PHP view::share使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view
的用法示例。
在下文中一共展示了view::share方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
$this->messageBag = new MessageBag();
//$countries can be accessed by any controller now
$countries = DB::table('countries')->orderBy('popular')->orderBy('name')->lists('name', 'id');
view::share('countries', $countries);
}
示例2: loadEvent
public function loadEvent($id)
{
$squeeb = Lecture::where('id', '=', $id)->first();
View::share('squeeb', $squeeb);
view::share('model', 'Event');
return View::make('guest.squeeb');
}
示例3: __construct
public function __construct(Service $service)
{
$this->beforeFilter('expired-session-check');
$this->service = $service;
$servicesNotContainedByAdvisor = $this->service->servicesNotContainedByAdvisor(Auth::user()->id);
$servicesContainedByAdvisor = $this->service->servicesContainedByAdvisor(Auth::user()->id);
$locationFormPopulator = Location::lists('name', 'id');
View::share('servicesNotContainedByAdvisor', $servicesNotContainedByAdvisor);
View::share('servicesContainedByAdvisor', $servicesContainedByAdvisor);
view::share('locationFormPopulator', $locationFormPopulator);
}
示例4: loadSqueeb
public function loadSqueeb($type, $id)
{
$squeeb = Squeeb::where('id', '=', $id)->first();
View::share('squeeb', $squeeb);
view::share('model', $type);
//detect device
$detect = new Mobile_Detect();
$deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
View::share('deviceType', $deviceType);
$views = $squeeb->views;
$squeeb->views = $views + 1;
$saved = $squeeb->save();
if (Auth::user()) {
return View::make('member.home_squeeb');
}
return View::make('guest.home_squeeb');
}
示例5: __construct
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
$this->messageBag = new MessageBag();
//$countries can be accessed by any controller now
view::share('countries', $this->countries);
}
示例6: postMemberPosts
public function postMemberPosts()
{
//verify the user input and create account
$validator = Validator::make(Input::all(), array('Typem' => 'required|in:Notice,Eventsq,Job,Offer', 'Title' => 'required|max:200', 'Description' => 'required', 'Pic' => 'image|max:3000'));
if ($validator->fails()) {
return Redirect::route('member-post-get')->withErrors($validator)->withInput()->with('global', 'Sorry!! Your Squeeb was not posted, please retry.');
} else {
$type = Input::get('Typem');
$title = Input::get('Title');
$description = Input::get('Description');
$description = $this->MakeUrls($description);
$squeeb = substr(strip_tags($description), 0, 300);
$campusid = $this->getDevice();
$file = Input::file('Pic');
//get the current user id
$user_id = Auth::user()->id;
//get the model name
$model = $type;
$the_squeeb = Squeeb::create(array('model' => $model, 'views' => 0, 'branch_id' => $campusid, 'create_day' => date("Y-m-d")));
if ($the_squeeb) {
//create the post details
$squeeb_id = 0;
$squeeb_id = $this->createSqueeb($model, $the_squeeb->id, $user_id, $title, $description, $squeeb);
//finally post the squeebe photo
if ($squeeb_id) {
$this->postUploadPhoto($type, $squeeb_id, $file);
}
if ($squeeb_id) {
$squeeb = Squeeb::where('id', '=', $the_squeeb->id)->first();
View::share('squeeb', $squeeb);
view::share('model', $type);
return View::make('member.squeeb_preview');
}
}
}
return Redirect::route('member-post-get')->with('global', 'Some Error Occured, Please try again');
}
示例7: getCreateuser
public function getCreateuser($id = 0)
{
$this->layout = View::make('layouts.admin');
$pageTitle = 'Manage User';
$frmBtn = 'Save';
$modelid = (int) $id;
$viewDataObj = '';
if (isset($modelid) && $modelid != 0) {
$viewDataObj = DB::table('users')->where('users.id', '=', $modelid)->first();
// Changing dob to d-m-y format before sending to view
if (isset($viewDataObj->expired_date)) {
if ($viewDataObj->expired_date == '0000-00-00') {
$viewDataObj->expired_date = '';
} else {
$viewDataObj->expired_date = $this->DB2Date($viewDataObj->expired_date);
}
}
}
$currentDat = date('Y-m-d');
$after15Days = date('m/d/Y', strtotime("+15 day {$currentDat}"));
$designationArr = $this->getDesignatonList();
$layoutArr = array('pageTitle' => $pageTitle, 'frmBtn' => $frmBtn, 'modelid' => $modelid, 'designationArr' => $designationArr, 'viewDataObj' => $viewDataObj, 'after15Days' => $after15Days);
$this->layout->content = View::make('users.createuser', array('layoutArr' => $layoutArr));
/*
* Setting student object in edit case to view so that
* we can itterate it in layout page in order to prefill
* the form element value
*/
view::share(array('viewDataObj' => $viewDataObj));
}