本文整理汇总了PHP中Department::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::lists方法的具体用法?PHP Department::lists怎么用?PHP Department::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Department
的用法示例。
在下文中一共展示了Department::lists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: index
/**
* Display a listing of the resource.
* GET /sppb
*
* @return Response
*/
public function index()
{
$query = DB::table('SPPB')->select('no_SPPB')->orderBy('no_SPPB', 'desc')->first();
$inisial = 'SPB';
if (!isset($query)) {
$kd = $inisial . '001';
} else {
$kode = substr($query->no_SPPB, 3);
$kode = $kode + 1;
if ($kode > 0) {
$kd = $inisial . '00' . $kode;
if ($kode > 9) {
$kd = $inisial . '0' . $kode;
if ($kode > 99) {
$kd = $inisial . $kode;
}
}
}
}
$data = array('department' => Department::lists('nm_dept', 'id_dept'), 'noSPPB' => $kd);
return View::make('transaksi.SPPB', $data);
}
示例3: Project
require 'model/professor.php';
$professor = new Project();
$app->get('/professors', function () {
global $professor, $conn, $app;
$query = $app->request()->params('query');
echo json_encode($professor->show($conn, $query));
// echo $condition;
});
/**
* Department
*/
require 'model/department.php';
$department = new Department();
$app->get('/departments/list', function () {
global $department, $conn;
echo json_encode($department->lists($conn));
});
/**
* Sponsor
*/
require 'model/sponsor.php';
$sponsor = new Sponsor();
$app->get('/sponsors', function () {
global $sponsor, $conn, $app;
$query = $app->request()->params('query');
echo json_encode($sponsor->show($conn, $query));
});
$app->get('/sponsors/list', function () {
global $sponsor, $conn;
echo json_encode($sponsor->lists($conn));
});