本文整理匯總了PHP中Problem::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP Problem::find方法的具體用法?PHP Problem::find怎麽用?PHP Problem::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Problem
的用法示例。
在下文中一共展示了Problem::find方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
$this->cache_control('private', 5);
if ($pid = fRequest::get('id', 'integer')) {
Util::redirect('/problem/' . $pid);
}
$view_any = User::can('view-any-problem');
$this->page = fRequest::get('page', 'integer', 1);
$this->title = trim(fRequest::get('title', 'string'));
$this->author = trim(fRequest::get('author', 'string'));
$this->problems = Problem::find($view_any, $this->page, $this->title, $this->author);
$this->page_url = SITE_BASE . '/problems?';
if (!empty($this->title)) {
$this->page_url .= 'title=' . fHTML::encode($this->title) . '&';
}
if (!empty($this->author)) {
$this->page_url .= 'author=' . fHTML::encode($this->author) . '&';
}
$this->page_url .= 'page=';
$this->page_records = $this->problems;
$this->nav_class = 'problems';
$this->render('problem/index');
}
示例2: getButtons
/**
* Return HTML buttons for flagging problem status
* @return string
*/
public function getButtons()
{
if (!isAdmin()) {
return "Log in ด้วยสิทธิ Admin เพื่อเปลี่ยนสถานะของปัญหา";
}
$problem = Problem::find(intval(Input::get('id')));
$type = $problem->problem_type;
$status = $problem->status;
$html = '';
// 'Error' Button
if ($type != 'HM' && $type != 'MP') {
$html .= $this->getErrorButton($problem->id, 'true', $status, 'btn btn-default');
}
//$html .= ' ';
// 'Not Error' Button
$html .= $this->getErrorButton($problem->id, 'false', $status, 'btn btn-default');
$html .= $this->getErrorButton($problem->id, 'undefined', $status, 'btn btn-default');
return $html;
// return Response::json($output);
}