PHPackages                             pendalf89/yii2-sitemap - 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. pendalf89/yii2-sitemap

ActiveYii2-extension

pendalf89/yii2-sitemap
======================

Yii2 sitemap component

12201PHP

Since Mar 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/PendalF89/yii2-sitemap)[ Packagist](https://packagist.org/packages/pendalf89/yii2-sitemap)[ RSS](/packages/pendalf89-yii2-sitemap/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 sitemap
============

[](#yii2-sitemap)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist pendalf89/yii2-sitemap "*"

```

or add

```
"pendalf89/yii2-sitemap": "*"

```

to the require section of your `composer.json` file.

Apply migration

```
yii migrate --migrationPath=vendor/pendalf89/yii2-sitemap/src/migrations
```

Configuration:

```
'components' => [
    'sitemap' => [
        'class' => 'pendalf89\sitemap\Sitemap',
        'sitemaps'  => [
        		'frontend\sitemaps\ArticlesSitemap', // see example of class below
        		'frontend\sitemaps\OtherSitemap', // see example of class below
        	],
        'generator' => [
            'class'   => 'pendalf89\sitemap\SitemapGenerator',
            'path'    => '@frontend/web',
            'baseUrl' => 'https://example.com',
        ],
    ],
],
```

Usage
-----

[](#usage)

In first, create sitemap classes, for example:

```
namespace frontend\sitemaps;

use pendalf89\sitemap\SitemapInterface;

class OtherSitemap implements SitemapInterface
{
	/**
	 * @inheritdoc
	 */
	public function getName()
	{
		return 'sitemap-other';
	}

	/**
	 * @inheritdoc
	 */
	public function getUrls()
	{
		return [
			['loc' => '/any-url/'],
			['loc' => '/any-url-width-date/', 'lastmod' => '2016-09-02 12:23:17'],
		];
	}
}
```

So, when you create sitemap classes, you can use component for create sitemap files.

```
Yii::$app->sitemap->update();
```

Also, you can update one url in DB:

```
Yii::$app->sitemap->updateUrl('/any-url-width-date/', '2016-09-02 12:23:17');
```

###  Health Score

23

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d4a4b4764a0393c51349746c05db96397f17cce78fa5c025609aa1bb3489eea?d=identicon)[PendalF89](/maintainers/PendalF89)

---

Top Contributors

[![PendalF89](https://avatars.githubusercontent.com/u/5278851?v=4)](https://github.com/PendalF89 "PendalF89 (8 commits)")

### Embed Badge

![Health badge](/badges/pendalf89-yii2-sitemap/health.svg)

```
[![Health](https://phpackages.com/badges/pendalf89-yii2-sitemap/health.svg)](https://phpackages.com/packages/pendalf89-yii2-sitemap)
```

PHPackages © 2026

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