dflydev/psr0-resource-locator-service-provider
Composer 安装命令:
composer require dflydev/psr0-resource-locator-service-provider
包简介
PSR-0 Resource Locator Service Provider
关键字:
README 文档
README
Provides a PRS-0 Resource Locator as a service to Silex applications.
Requirements
- PHP 5.3+
- A PSR-0 Resource Locator Implementation
- Composer — dflydev/psr0-resource-locator-composer
Installation
Through Composer
Usage
The following is an example using the Composer PSR-0 Resource Locator implementation (dflydev/psr0-resource-locator-composer):
<?php use Dflydev\Silex\Provider\Psr0ResourceLocator\Psr0ResourceLocatorServiceProvider; use Dflydev\Silex\Provider\Psr0ResourceLocator\Composer\ComposerResourceLocatorServiceProvider; use Silex\Application; $app = new Application; $app->register(new Psr0ResourceLocatorServiceProvider); $app->register(new ComposerResourceLocatorServiceProvider); // Search all PSR-0 namespaces registered by Composer // to find the first directory found looking like: // "/Vendor/Project/Resources/mappings" $mappingDirectory = $app['psr0_resource_locator']->findFirstDirectory( 'Vendor\Project\Resources\mappings' ); // Search all PSR-0 namespaces registered by Composer // to find all templates directories looking like: // "/Vendor/Project/Resources/templates" $templateDirs = $app['psr0_resource_locator']->findDirectories( 'Vendor\Project\Resources\templates', );
Configuration
Parameters
-
psr0_resource_locator.implementation: String containing the name of the service that implements the PSR-0 Resource locator interface.
This should probably be set by the implementation in its own Service Provider.
Services
- psr0_resource_locator:
PSR-0 Resource Locator, instance
Dflydev\Psr0ResourceLocator\Psr0ResourceLocatorInterface.
License
MIT, see LICENSE.
Community
If you have questions or want to help out, join us in the #dflydev or #silex-php channels on irc.freenode.net.
统计信息
- 总下载量: 646
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2012-11-07