本文整理汇总了PHP中Location::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::lists方法的具体用法?PHP Location::lists怎么用?PHP Location::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location::lists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doChooseEmployee
/**
* User chose single employee from dropdown to be edited
*
* @return mixed
*/
public function doChooseEmployee()
{
$employee = Employee::find(Input::get('choose'));
$dept = ['' => 'Choose...'] + Department::lists('name', 'id');
$location = ['' => 'Choose...'] + Location::lists('name', 'id');
return View::make('admin.edit-employee', compact('dept', 'location', 'employee'));
}
示例2: create
/**
* Show the form for creating a new calendarevent
*
* @return Response
*/
public function create()
{
$locations = ['-1' => 'none'] + Location::lists('name', 'id');
// $locations = Location::lists('name', 'id');
// $locations = array_add($locations, '-1', '');
return View::make('makeEvent', compact('locations'));
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$community_event = $this->community_event->find($id);
$locations = Location::lists('location_name', 'id');
if (is_null($community_event)) {
return Redirect::route('community_events.index');
}
return View::make('community_events.edit', compact('community_event', 'locations'));
}
示例4: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$opportunity = $this->opportunity->find($id);
$locations = Location::lists('location_name', 'id');
$group = Opportunity::find($id);
$skills = Skill::all();
$assigned = $group->skills->lists('id');
if (is_null($opportunity)) {
return Redirect::route('opportunities.index');
}
return View::make('opportunities.edit', compact('opportunity', 'locations', 'group', 'skills', 'assigned'));
}