skyline/direct-components-forwarding
Composer 安装命令:
composer require skyline/direct-components-forwarding
包简介
README 文档
README
This package allows you to register directories as direct accessable component sources.
Installation
$ composer require skyline/direct-components-forwarding
Usage
With this package, another Component class is available.
Just use it in your component.config.php file:
<?php use Skyline\Component\Config\OpenDirectoryComponent; return [ // Can be any name. Including it into template has no effect. 'Open' => new OpenDirectoryComponent( '/Library', // URI prefix => <img src="/Public/Library/my-image.jpg"> __DIR__ . "/path/to/library" ) ];
This example will look for a file at:
__DIR__ . "/path/to/library/my-image.jpg
If it finds one, its gonna be delivered, otherwise a 404 error is given (except other plugins are able to resolve the request into a existing component.)
Please note that the URIs and paths are recursive:
<img src="/Public/Library/media/users/me.jpg" />
will be resolved to
<?php __DIR__ . "/path/to/library/media/users/me.jpg";
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-11-01