本文整理汇总了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'));
}