I added a simple search function in the skeleton app developed by Jonah. It should also applies to the original blog app and the enhanced blog app by mocapapa.
If you need an enhanced version, you may want mocapapa's version. I use this version for an internal app that needs very simple search functionality.
For the original blog app, only 3 lines are affected.
Files affected:
controller/PostController.php
views/post/list.php
PostController.php
Change
public function actionList() { $criteria=new CDbCriteria; $criteria->condition='status='.Post::STATUS_PUBLISHED;
into
public function actionList($search) { $criteria=new CDbCriteria; $criteria->condition='status='.Post::STATUS_PUBLISHED; if(isset($_GET['search'])) {$criteria->contion='content like '%'.$_GET['search'].'%'';}
in view/post/list.php
add the following after line 12
<form action="<?php echo Yii::app()->baseUrl.'/post/list';?>" method="get"> <input type="text" name="search" size="30"> <input type="submit" value="Submit" /></form>