//controller
$model=Book::model()->find(array('book'=>':book'),array(':book'=>$book));
$this->render('view',array('model'=>$model));
//in the view
if (!count($model)){
$this->beginWidget('zii.widgets.jui.CJuiDialog',array('autoOpen'=>true));
echo 'no book\'s result from your search.Try to be less specific';
$this->endWidget();
}else{
//display the book details
print_r($model);
}