本文整理汇总了PHP中Illuminate\Contracts\View\View::make方法的典型用法代码示例。如果您正苦于以下问题:PHP View::make方法的具体用法?PHP View::make怎么用?PHP View::make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\View\View
的用法示例。
在下文中一共展示了View::make方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$society = $view->getData()['soc'];
$data['services'] = Society::with('service')->where('society', '=', $society)->first();
foreach ($data['services']->service as $service) {
if ($service['language'] == "English" and $service['description'] == "") {
$service->description = "Our " . $service->servicetime . " service is led in English by a minister or local preacher and a team of musicians. Everyone is welcome!";
} elseif ($service['language'] == "isiZulu" and $service['description'] == "") {
$service->description = "Our " . $service->servicetime . " service is led in isiZulu by a minister or local preacher and uses the liturgy and music of the Methodist Hymn Book. Everyone is welcome!";
}
$data['allservices'][] = $service;
}
if (!count($data['services'])) {
return View::make('errors.404');
}
if (isset($view->getData()['pagetitle'])) {
$data['pagetitle'] = $view->getData()['pagetitle'];
} else {
$data['pagetitle'] = $society;
}
$socid = Society::where('society', '=', $society)->select('id')->first()->id;
if (Helpers::is_online() and $data['services']->society_calendar != "") {
$privatecal = new GoogleCalendar();
$data['cals'] = $privatecal->getTen($data['services']->society_calendar, 8);
}
$data['sermon'] = Sermon::with(['series' => function ($query) use($socid) {
$query->where('society_id', '=', $socid);
}])->orderBy('servicedate', 'DESC')->first();
if (!$data['sermon'] or !$data['sermon']->series) {
$data['sermon'] = "None";
} else {
if ($data['sermon']->preachable_type == 'App\\Models\\Minister') {
$data['preacher'] = Minister::find($data['sermon']->preachable_id);
} elseif ($data['sermon']->preachable_type == 'App\\Models\\Guest') {
$data['preacher'] = Guest::find($data['sermon']->preachable_id);
} else {
$data['preacher'] = Preacher::find($data['sermon']->preachable_id);
}
}
$data['welcome_page'] = "together a transforming discipleship movement";
$data['welcome_page_pic'] = "/public/images/715.jpg";
if ($data['services']->roster) {
$data['roster'] = $data['services']->roster;
}
$data['society'] = Society::where('society', '=', $society)->first();
if ($data['society']->roster) {
$data['roster'] = $data['society']->roster;
}
$webpage = Webpage::where('society_id', '=', $data['society']->id)->get();
foreach ($webpage as $pg) {
$data[$pg->fieldname] = $pg->fieldvalue;
$data[$pg->fieldname . '_pic'] = $pg->pageimage;
}
$data['route'] = Route::getCurrentRoute()->getPath();
if ($data['route'] != "{society}" and $data['route'] != "/") {
$linkadd = Helpers::makeUrl(strtolower($society), '');
} else {
$linkadd = "";
}
$menu['link'] = $linkadd . "#sundays";
$menu['label'] = "Sundays";
$menu['longlabel'] = "Sunday services";
$data['menu'][] = $menu;
$data['youth'] = Mission::where('society_id', '=', $data['society']->id)->where('category', '=', 'youth')->orderBy('created_at')->take(5)->get();
if (count($data['youth'])) {
$menu['link'] = $linkadd . "#youth";
$menu['label'] = "Youth";
$menu['longlabel'] = "Children and Youth";
$data['menu'][] = $menu;
}
$data['groups'] = Group::where('society_id', '=', $data['society']->id)->where('publish', '=', 1)->get();
if (count($data['groups'])) {
foreach ($data['groups'] as $obj) {
$dum[0] = $obj->groupname;
$dum[1] = $obj->latitude;
$dum[2] = $obj->longitude;
$dum[3] = Helpers::makeUrl(strtolower($data['services']->society), 'groups/' . $obj->slug);
$fin[] = $dum;
}
$data['fin'] = json_encode($fin);
$menu['link'] = "#groups";
$menu['label'] = "Groups";
$menu['longlabel'] = "Small groups";
$data['menu'][] = $menu;
} else {
$data['fin'] = "";
}
$data['missions'] = Mission::where('society_id', '=', $data['society']->id)->where('category', '=', 'project')->take(5)->get();
if (count($data['missions'])) {
$menu['link'] = $linkadd . "#projects";
$menu['label'] = "Projects";
$menu['longlabel'] = "Mission projects";
$data['menu'][] = $menu;
}
//.........这里部分代码省略.........