19 lines
334 B
PHP
19 lines
334 B
PHP
<?php
|
|
|
|
Yii::import('zii.widgets.CPortlet');
|
|
|
|
class RecentComments extends CPortlet
|
|
{
|
|
public $title='Recent Comments';
|
|
public $maxComments=10;
|
|
|
|
public function getRecentComments()
|
|
{
|
|
return Comment::model()->findRecentComments($this->maxComments);
|
|
}
|
|
|
|
protected function renderContent()
|
|
{
|
|
$this->render('recentComments');
|
|
}
|
|
} |