PHPackages                             zyan/thinkphp3-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zyan/thinkphp3-sitemap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zyan/thinkphp3-sitemap
======================

laravel-sitemap生成器

1.0.6(3y ago)018MITPHP

Since Oct 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/aa24615/thinkphp3-sitemap)[ Packagist](https://packagist.org/packages/zyan/thinkphp3-sitemap)[ RSS](/packages/zyan-thinkphp3-sitemap/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (8)Used By (0)

zyan/laravel-thinkphp3
======================

[](#zyanlaravel-thinkphp3)

thinkphp3框架 sitemap快速生成

要求
--

[](#要求)

1. php &gt;= 7.2
2. Composer

安装
--

[](#安装)

```
composer require zyan/thinkphp3-sitemap -vvv
```

使用
--

[](#使用)

```
use Zyan\Sitemap\Sitemap;

//根地址
$baseUrl = 'http://www.php127.com/';

$sitemap = Factory::tp3Sitemap($baseUrl);
$sitemap->table('表名')->where(['where条件 可不传'])->field(['字段'])->url('url规则')->make();

//可生成多个表
$sitemap->table('表名')->url('url规则')->make();
```

table

```
//不需要填写前缀
$sitemap->table('article')->make();
```

where\[可选\]

```
//请参考tp3手册中where传数组的方法
$sitemap->table('article')->where([['id','>',1000],['state','=',1]])->make();
```

field

```
//请参考tp3手册field传的方法 注意这里转换成数组
$sitemap->table('article')->field(['id','...'])->make();
```

url

```
//配合field字段为变量替换url 请用{}括起来
$sitemap->table('article')->field(['id'])->url('/article/{uid}.html')->make();
//可以有多个
$sitemap->table('article')->field(['id','type'])->url('/article/{type}/{uid}.html')->make();
//也可以指定域名 不指定默认以 读取 config('app.url')
$sitemap->table('article')->field(['id','type'])->url('http://www.php127.com/article/{id}.html')->make();
```

make

```
//开始生成
$sitemap->table('article')->field(['id'])->url('/user/{id}.html')->make();
```

生成结果
----

[](#生成结果)

暂时仅支持txt格式 /sitemap/map.txt 为索引文件对应下面的url 请将这里的网址添加到百度站长即可

```
http://www.php127.com/sitemap/article_1.txt
http://www.php127.com/sitemap/article_2.txt
http://www.php127.com/sitemap/article_3.txt
...
```

/sitemap/表名\_分页.txt
/sitemap/article\_1.txt
/sitemap/article\_2.txt
/sitemap/article\_3.txt

> 以上是默认目录的生成结果,如果您指定了目录,请自行修改上传后对应该路径

相关包
---

[](#相关包)

- [laravel-sitemap](https://github.com/aa24615/laravel-sitemap)
- [thinkphp3-sitemap](https://github.com/aa24615/thinkphp3-sitemap)
- [thinkphp-sitemap](https://github.com/aa24615/thinkphp-sitemap)
- [sitemap-output](https://github.com/aa24615/sitemap-output)
- [sitemap-url](https://github.com/aa24615/sitemap-url)

参与贡献
----

[](#参与贡献)

1. fork 当前库到你的名下
2. 在你的本地修改完成审阅过后提交到你的仓库
3. 提交 PR 并描述你的修改，等待合并

License
-------

[](#license)

[MIT license](https://opensource.org/licenses/MIT)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~0 days

Total

7

Last Release

1350d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33275679?v=4)[读心印](/maintainers/aa24615)[@aa24615](https://github.com/aa24615)

---

Top Contributors

[![aa24615](https://avatars.githubusercontent.com/u/33275679?v=4)](https://github.com/aa24615 "aa24615 (7 commits)")

---

Tags

Sitemapthinkphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zyan-thinkphp3-sitemap/health.svg)

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

###  Alternatives

[samdark/sitemap

Sitemap and sitemap index builder

5401.4M44](/packages/samdark-sitemap)[tackk/cartographer

A PHP sitemap generation tool.

325493.4k3](/packages/tackk-cartographer)[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.5M58](/packages/nystudio107-craft-seomatic)[novactive/ezseobundle

Novactive eZ SEO Bundle is an Ibexa Platform bundle for SEO simplications. metas, sitemaps, robots.txt, etc.

29259.4k3](/packages/novactive-ezseobundle)[rainlab/sitemap-plugin

Sitemap plugin for October CMS

2282.4k1](/packages/rainlab-sitemap-plugin)[fof/sitemap

Generate a sitemap

1899.7k2](/packages/fof-sitemap)

PHPackages © 2026

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