Difference between #1 and #3 of
How to create a Widget - Recent Comments widget

Changes

Title unchanged

How to create a Widget - Recent Comments widget

Category unchanged

How-tos

Yii version changed

1.1

Tags changed

Widgets, comments, themingtheming,comments

Content changed

[...]
**Step 1: - Creating a Widget Component**

**components/Comments.php**


```php

Yii::import('zii.widgets.CPortlet');
[...]

```php
<ul> <?php $comments = $this->getComments(); foreach($comments as $comment)
{
echo "<li> {$comment->fieldName}</li>";
[...]

```php

public function findRecentComments($limit=null)
{
[...]

```php

$this->widget('Comments', array(
'maxComments'=>10,
));

```
[...]
5 0
6 followers
Viewed: 43 474 times
Version: 1.1
Category: How-tos
Written by: Nisanth thulasi
Last updated by: samdark
Created on: Jun 11, 2014
Last updated: 5 years ago
Update Article

Revisions

View all history