PHPackages                             singularity/yii2-sitemapgenerator - 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. singularity/yii2-sitemapgenerator

ActiveYii2-extension

singularity/yii2-sitemapgenerator
=================================

Sitemap Generator for Yii2 framework

012PHP

Since Nov 26Pushed 5y ago3 watchersCompare

[ Source](https://github.com/singularity-is/yii2-sitemapgenerator)[ Packagist](https://packagist.org/packages/singularity/yii2-sitemapgenerator)[ RSS](/packages/singularity-yii2-sitemapgenerator/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Sitemap Generator for Yii2
==========================

[](#sitemap-generator-for-yii2)

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

[](#installation)

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

Either run

```
composer require singularity/yii2-sitemapgenerator
```

or add

```
"singularity/yii2-sitemapgenerator": "~1.0"

```

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

Usage
-----

[](#usage)

Quick example:

```
$generator = new SitemapGenerator([
    'maxURLsPerSitemap' => 20000,
    'basePath' => 'frontend/web',
    'items' => [
        'https://mysite.com',                      // url as string
        ['class' => User::class],                  // array with ['class'] that have getPublicUrl() method
        [
            'class' => Post::class,               // if ['class'] does not have getPublicUrl() method,
            'url' => function (Post $model) {     // then ['url'] must be set
                return ["/post/view/$model->id"]; // ['url'] can be value or callback
            }
        ]
    ]
]);

$count = $generator->generate();
```

Properties
----------

[](#properties)

- baseUrl
- basePath
- items
- sitemapFilename
- sitemapIndexFilename
- robotsFilename
- maxURLsPerSitemap
- fs
- runtime

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Dositej Grbovic](https://dositej-dev.com)
- [All Contributors](https://github.com/singularity-is/yii2-sitemapgenerator/graphs/contributors)

License
-------

[](#license)

The BSD License (BSD). Please see [License File](LICENSE.md) for more information.

[![](https://camo.githubusercontent.com/b2386d186828d39e5f401fe1a45928ff42670d97e6bf663f60ec822c111ac9fd/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f38363633643438656136303933643263653931373231376365656361316363322e706e67)](https://singularity.is)
*\#InventTomorrow*
[www.singularity.is](https://www.singularity.is)

###  Health Score

17

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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/0c3db6404eafa14c3331c07a28194e9f4a54005a9cf2d2de1a11322f42091c8a?d=identicon)[dositej](/maintainers/dositej)

---

Top Contributors

[![dositejg](https://avatars.githubusercontent.com/u/17592230?v=4)](https://github.com/dositejg "dositejg (5 commits)")

### Embed Badge

![Health badge](/badges/singularity-yii2-sitemapgenerator/health.svg)

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

PHPackages © 2026

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