PHPackages                             trendsoft/themes - 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. trendsoft/themes

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

trendsoft/themes
================

多主题管理

0.1.0(8y ago)114MITPHPPHP &gt;=7.0

Since Dec 26Pushed 8y ago2 watchersCompare

[ Source](https://github.com/trendsoft/themes)[ Packagist](https://packagist.org/packages/trendsoft/themes)[ Docs](http://www.trendsoft.org)[ RSS](/packages/trendsoft-themes/feed)WikiDiscussions master Synced 3d ago

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

Themes
======

[](#themes)

> 主题管理,读取指定目录下的主题目录,并通过简单的方式获取对应主题的资源文件.

[![Build Status](https://camo.githubusercontent.com/ea033c7e6b71f10dc827f2fc3985c919748f8c2b01abe6e858de25c5c35eb259/68747470733a2f2f7472617669732d63692e6f72672f7472656e64736f66742f7468656d65732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/trendsoft/themes)[![Latest Stable Version](https://camo.githubusercontent.com/226bf51053f5e8765fa4b3175847010958f55e5dd0c3a277a1fd1bdf53993cf3/68747470733a2f2f706f7365722e707567782e6f72672f7472656e64736f66742f7468656d65732f762f737461626c65)](https://packagist.org/packages/trendsoft/themes)[![Latest Unstable Version](https://camo.githubusercontent.com/eba258f18febecac35b1c587713b7b3860b672a06e2c065f8c13db841e09b4a0/68747470733a2f2f706f7365722e707567782e6f72672f7472656e64736f66742f7468656d65732f762f756e737461626c65)](https://packagist.org/packages/trendsoft/themes)[![StyleCI](https://camo.githubusercontent.com/e2d1b01bda10f4d7452703b6a3d084d2f18d67241aa900c33863fcd985399c6c/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131353138303938312f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/115180981)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e384e75caa7a638dbbb301cd35d2c1612548194b6dbd36954cbafd24baa6ec38/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7472656e64736f66742f7468656d65732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/trendsoft/themes/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/15df65cace94583dc66e950537f1fbeed3bc8110add8381dead5cb6ae7ebf712/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7472656e64736f66742f7468656d65732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/trendsoft/themes/?branch=master)[![Build Status](https://camo.githubusercontent.com/8a18a15217726c687bb7c877f59066e721104454b4e7da6f9097aef114ad241c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7472656e64736f66742f7468656d65732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/trendsoft/themes/build-status/master)[![License](https://camo.githubusercontent.com/2a986223e027cec431c0879b415d4344657334b0dd8f09565c5e4873910af4aa/68747470733a2f2f706f7365722e707567782e6f72672f7472656e64736f66742f7468656d65732f6c6963656e7365)](https://packagist.org/packages/trendsoft/themes)[![Total Downloads](https://camo.githubusercontent.com/17e98da3f8c740fd8d46b97c1a8f8c1a3d87db968da78e625bdf264a52669965/68747470733a2f2f706f7365722e707567782e6f72672f7472656e64736f66742f7468656d65732f646f776e6c6f616473)](https://packagist.org/packages/trendsoft/themes)[![Monthly Downloads](https://camo.githubusercontent.com/e219289737316cdafb651e273c99418ee15b193929b937c826bdb204f48c7bfa/68747470733a2f2f706f7365722e707567782e6f72672f7472656e64736f66742f7468656d65732f642f6d6f6e74686c79)](https://packagist.org/packages/trendsoft/themes)[![Daily Downloads](https://camo.githubusercontent.com/59b89a2d8344014b95f5f34c17ecdfd6c9f146c8ff9e6603d3000edfd2fa41c1/68747470733a2f2f706f7365722e707567782e6f72672f7472656e64736f66742f7468656d65732f642f6461696c79)](https://packagist.org/packages/trendsoft/themes)

要求
==

[](#要求)

- PHP &gt;= 7.0
- Composer

安装
==

[](#安装)

```
$ composer require "trendsoft/themes" -vvv

```

使用示例
====

[](#使用示例)

```
$theme = new Theme($config);
$theme->asset('app.js'); //获取资源
$theme->all(); //获取所有主题列表
$theme->path('assets/app.css'); //获取主题目录assets目录下的app.css文件
```

配置文件
----

[](#配置文件)

```
return array('active' => 'default', 'paths'  => [ 'absolute' => $this->getAbsolute(), 'base' => 'themes', 'assets' => 'assets' ]);
```

- active:默认使用的主题slug
- paths:
    - absolute:绝对路径
    - base:主题目录uri相对路径
    - assets:资源目录

创建主题
----

[](#创建主题)

在absolute对应的目录中创建一个以主题slug命名的目录，并在此目录中创建theme.json文件，theme.json文件格式如下：

```
{
  "slug": "bootstrap",
  "name": "Bootstrap",
  "author": "Jabber",
  "description": "is a bootstrap theme",
  "version": "0.1.0"
}
```

主题列表
----

[](#主题列表)

```
$theme->all();
```

应用主题
----

[](#应用主题)

```
$theme->active('vue'); //or $theme->setCurrent('vue');
```

Contribution
============

[](#contribution)

[Contribution Guide](.github/CONTRIBUTING.md)

License
=======

[](#license)

MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

3062d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e3877002e2232ea95aa1565da2d9b54ce841aed725a661e30678d2e80731a8f?d=identicon)[hu19891110](/maintainers/hu19891110)

---

Top Contributors

[![2898117012](https://avatars.githubusercontent.com/u/20187449?v=4)](https://github.com/2898117012 "2898117012 (39 commits)")

---

Tags

php7themephptheme

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/trendsoft-themes/health.svg)

```
[![Health](https://phpackages.com/badges/trendsoft-themes/health.svg)](https://phpackages.com/packages/trendsoft-themes)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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