PHPackages                             noname9/yii2-atom-rss - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. noname9/yii2-atom-rss

ActiveYii2-extension[Parsing &amp; Serialization](/categories/parsing)

noname9/yii2-atom-rss
=====================

Yii2 Framework extension to provide functionality for consuming RSS and Atom feeds using zend-feed library.

1.0(10y ago)0574BSD-3-ClausePHPPHP &gt;=5.4.0

Since Aug 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/noname9/yii2-atom-rss)[ Packagist](https://packagist.org/packages/noname9/yii2-atom-rss)[ Docs](https://github.com/noname9/yii2-rss)[ RSS](/packages/noname9-yii2-atom-rss/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

yii2-atom-rss
=============

[](#yii2-atom-rss)

Yii2 Framework extension to provide functionality for consuming RSS and Atom feeds using zend-feed library.

Installation
------------

[](#installation)

```
{
	"require":
	{
  		"noname9/yii2-atom-rss": "*"
	}
}

```

Configuration
-------------

[](#configuration)

In config file

```
/config/web.php

```

Add feed component

```
'components' => array(
        ...
        'feed' => array(
        	 	'class' => 'yii\feed\FeedDriver',
        		),
		    )

```

Simple usage
------------

[](#simple-usage)

**Read Rss feed:**

```
$feed=Yii::$app->feed->reader()->import('http://exapmple.com/feed.rss');
```

This will get RSS feed, parse it and return feed object. For more details you can read the official Zend-feed extention documentaion:

**Create Rss feed:**

Create action Rss in controller

```
public function actionRss(){

     $feed=Yii::$app->feed->writer();

    $feed->setTitle(Yii::$app->params['title']);
		$feed->setLink('http://example.com');
		$feed->setFeedLink('http://example.com/rss', 'rss');
		$feed->setDescription(Yii::t('app','Recent headlines'));
		$feed->setGenerator('http://example.com/rss');
		$feed->setDateModified(time());
		/**
		* Add one or more entries. Note that entries must
		* be manually added once created.
		*/
		$posts=Post::find()->orderBy('id DESC')->limit(20)->all();
		foreach($posts as $post){
				$entry = $feed->createEntry();
				$entry->setTitle($post->title);
				$entry->setLink(Yii::$app->urlManager->createAbsoluteUrl('/post/view',['id'=>$post->id]));
				$entry->setDateModified(intval($post->created));
				$entry->setDateCreated(intval($post->created));
				$entry->setContent(
				   $post->content
				);
				$entry->setEnclosure(
					[
					 'uri'=>$post->image,
					 'type'=>'image/jpeg',
					 'length'=>filesize(Yii::getAlias('@webroot').$post->image)
					 ]
				);
				$feed->addEntry($entry);
		}
		/**
		* Render the resulting feed to Atom 1.0 and assign to $out.
		* You can substitute "atom" with "rss" to generate an RSS 2.0 feed.
		*/
		$out = $feed->export('rss');
		header('Content-type: text/xml');
		echo $out;
		die();
	}
```

Then it's better to cache it with cache component:

```
public function behaviors() {
		return [
			....
			'cache'=> [
				'only'=>['rss'],
				'class'=>PageCache::className(),
				'duration'=>0,
				'dependency'=>[
					       'class' => 'yii\caching\DbDependency',
					       'sql' => 'SELECT max(time_updated) as max FROM tbl_post',

					      ],
			]
		];
	}
```

Take a look at Zend-feed writer official documentaion for more advanced usage of Zend-feed

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3927d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d91982a9c7d80676d2810505e84b0897266b1a70dd251d67ac4205d91ca9c8b?d=identicon)[noname9](/maintainers/noname9)

---

Top Contributors

[![SerhiiKalita](https://avatars.githubusercontent.com/u/13070582?v=4)](https://github.com/SerhiiKalita "SerhiiKalita (9 commits)")

---

Tags

atomfeedrssyii2extension

### Embed Badge

![Health badge](/badges/noname9-yii2-atom-rss/health.svg)

```
[![Health](https://phpackages.com/badges/noname9-yii2-atom-rss/health.svg)](https://phpackages.com/packages/noname9-yii2-atom-rss)
```

###  Alternatives

[bnomei/kirby3-feed

Generate a Atom/JSON/RSS-Feed and XML-Sitemap from Pages-Collections

7224.8k](/packages/bnomei-kirby3-feed)[kdn/yii2-json-editor

JSON editor widget (josdejong/jsoneditor) for Yii 2.

22570.0k3](/packages/kdn-yii2-json-editor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
