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. zyan/thinkphp3-sitemap

ActiveLibrary

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 1mo ago

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 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

1304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbcdf7ec634eb735375fa4f6046f91646934f9eb07456f4b4dcbdec545c6435b?d=identicon)[aa24615](/maintainers/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

[topthink/think

the new thinkphp framework

8.0k1.2M13](/packages/topthink-think)[topthink/framework

The ThinkPHP Framework.

2.8k3.2M1.3k](/packages/topthink-framework)[presta/sitemap-bundle

A Symfony bundle that provides tools to build your application sitemap.

3929.4M28](/packages/presta-sitemap-bundle)[samdark/sitemap

Sitemap and sitemap index builder

5491.4M37](/packages/samdark-sitemap)[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.4M46](/packages/nystudio107-craft-seomatic)[rumenx/php-sitemap

Framework-agnostic Sitemap generator for PHP, Laravel, and Symfony.

1.3k15.1k1](/packages/rumenx-php-sitemap)

PHPackages © 2026

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