PHPackages                             swoft-ext/component - 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. swoft-ext/component

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

swoft-ext/component
===================

swoft-ext-component

013PHP

Since Jun 19Pushed 6y agoCompare

[ Source](https://github.com/Johnzero/swoft-ext)[ Packagist](https://packagist.org/packages/swoft-ext/component)[ RSS](/packages/swoft-ext-component/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

swoft-ext
=========

[](#swoft-ext)

swoft 组件

swoft-blade
===========

[](#swoft-blade)

Lavarel*5.6* blade模板引擎移植

### 安装

[](#安装)

需要把composer源切为`https://packagist.laravel-china.org`，或国外源。

运行： `composer require lldca/swoft-blade`

如果安装后使用有问题，请运行 `composer update` 更新下最新的swoft组件。

### Swoft配置

[](#swoft配置)

在配置文件 `config/properties/app.php` 结尾处添加如下配置：

```
'components' => [
    'custom' => [
        'Swoft\\Blade\\'
    ],
],
'blade-view' => [
    'path' => '@root/resources/views', // 默认模板路径
    'compiled' => '@root/runtime/views', // 编译模板缓存路径
    'namespaces' => [ // 视图命名空间

    ],
    'assets' => [ // 静态资源读取目录

    ],
    'read-assets' => true, // 开启加载静态资源
],
```

### 使用

[](#使用)

```
 /**
 * @RequestMapping("index")
 *
 * @return \Psr\Http\Message\ResponseInterface
 */
public function index()
{
    return blade('test::main.index', ['msg' => '测试'])
        ->toResponse()
        ->withAddedHeader('Content-Type', 'charset=utf-8');
}
```

静态资源加载工具配置说明

```
/*
 | 静态资源帮助工具配置
 |
 */
'assets' => [
    // 静态资源域名配置(默认域名)
    'resource-server' => env('ASSETS_SERVER', '//default.com'),

    // js文件请求后缀
    'js-version' => '',

    // css文件请求后缀
    'css-version' => '',

    // 静态资源别名配置
    'alias' => [
        'test1' => '/assets/test1', // 不填写完整地址, 会使用"resource-server"参数配置的值作为域名
        'test2' => '//xxx.com/assets/test2', // 填写完整地址, 但是域名使用相对路径
        'test3' => 'https://xxx.com/assets/test3', // 填写完整地址
    ],
],
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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/9a105f90c601797afac9fda15b5cbb5ef67b1ddaf7a6d1edf7f2dda6bb121ad7?d=identicon)[Johnzero](/maintainers/Johnzero)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/swoft-ext-component/health.svg)

```
[![Health](https://phpackages.com/badges/swoft-ext-component/health.svg)](https://phpackages.com/packages/swoft-ext-component)
```

PHPackages © 2026

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