本文整理匯總了PHP中Topic::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Topic::search方法的具體用法?PHP Topic::search怎麽用?PHP Topic::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Topic
的用法示例。
在下文中一共展示了Topic::search方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: searchTopicsMessages
/**
* searchTopicsMessages-funktio hakee hakusanan perusteella topics-mallista ja messages-mallista löytyykö niistä hakusanaa vastaavia keskusteluja ja viestejä
*/
public static function searchTopicsMessages()
{
$searchword = $_POST['searchword'];
$topics = Topic::search($searchword);
$messages = Message::search($searchword);
$users = User::all();
$categories = Category::all();
$user = self::get_user_logged_in();
View::make('hallinto.html', array('searchword' => $searchword, 'user' => $user, 'users' => $users, 'topics' => $topics, 'messages' => $messages, 'categories' => $categories));
}
示例2: actionALltopic
/**
* 全部話題
*/
public function actionALltopic()
{
$criteria = new CDbCriteria();
$criteria->addCondition("parent_id=0");
$topicModel = Topic::model()->findAll($criteria);
$criteria = new CDbCriteria();
$criteria->order = "create_time asc";
$model = Topic::model()->find($criteria);
$newModel = new Topic();
$id = isset($_GET["id"]) ? $_GET["id"] : ($model ? $model->id : 0);
$topicDataProvider = $newModel->search($id);
$hotDataProvider = $newModel->search($id);
$this->render('alltopic', array('topicModel' => $topicModel, "model" => $model, 'topicDataProvider' => $topicDataProvider, 'hotDataProvider' => $hotDataProvider));
}