本文整理匯總了PHP中Teacher::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Teacher::search方法的具體用法?PHP Teacher::search怎麽用?PHP Teacher::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Teacher
的用法示例。
在下文中一共展示了Teacher::search方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: show_form
function show_form()
{
$name = _req('name');
$teacher = _req('teacher');
$description = _req('description');
$teachers = Teacher::search()->find(Searcher::KEY_VALUE_PAIR);
render_view('master', compact('teachers', 'name', 'teacher', 'description'));
}
示例2: index
/**
* @file index
* @author ryan <cumt.xiaochi@gmail.com>
* @created Jun 27, 2012 6:24:01 PM
*/
function index()
{
$recentTeachers = Teacher::search()->orderBy('touched DESC')->find();
$recentComments = Comment::search()->OrderBy('id DESC')->find();
$data = compact('recentTeachers', 'recentCourses', 'recentComments');
if ($GLOBALS['has_login']) {
$timelines = Timeline::search()->filterBy('user', $GLOBALS['user'])->find();
$data['timelines'] = $timelines;
}
render_view('master', $data);
}
示例3: search_teacher
function search_teacher($q)
{
$s = Teacher::search();
if ($q) {
$s = $s->filterBy('name', "%{$q}%", 'LIKE');
}
$school = _get('school');
if ($school !== '') {
$s = $s->filterBy('school', $school);
}
$teachers = $s->find();
render_view('master', compact('teachers', 'q'));
}
示例4: teachers_GET
/**
* @author ryan <cumt.xiaochi@gmail.com>
*/
function teachers_GET()
{
$teachers = Teacher::search()->find();
render_view('master', compact('teachers'));
}