# SiteController.php
public function actionNovosti() {
$this->render('novosti');
}
# protected/views/site/novosti.php
pageTitle=Yii::app()->name; ?>
findAll('parent_id=3 ORDER BY id DESC');
foreach($news as $key => $new) {
if (strlen($new->content) > 300) {
$text = strip_tags($new->content);
$pos = strpos($text, ' ', 300);
$buffer = substr($text, 0, $pos);
echo
"-
{$buffer}
";
} else {
echo
"-
{$new->content}
";
}
}
?>