Added DB Access + Error page
This commit is contained in:
19
demos/blog/protected/components/RecentComments.php
Normal file
19
demos/blog/protected/components/RecentComments.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user