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