gnugat / redaktilo-bundle
提供 Redaktilo 编辑器和 TextFactory 作为服务
v1.5.2
2015-12-01 17:48 UTC
Requires
- gnugat/redaktilo: ~1.7.0
- symfony/config: ^2.3|^3.0
- symfony/dependency-injection: ^2.3|^3.0
- symfony/http-kernel: ^2.3|^3.0
- symfony/yaml: ^2.3|^3.0
Requires (Dev)
- phpunit/phpunit: ^4.5|^5.0
- symfony/framework-bundle: ^2.3|^3.0
README
在 Redaktilo 中提供以下服务,用于 Symfony2 应用程序
redaktilo.editor
:一个Gnugat\Redaktilo\Editor
的实例
文档
扩展
您还可以通过创建新的 SearchStrategy
和新的 Command
来扩展 Redaktilo。
要使您的自定义 Command
和 SearchStrategy
可用,只需在您的 Symfony2 应用程序中将它们定义为服务并标记它们
services: acme_redaktilo.custom_command: class: Acme\RedaktiloBundle\Command\CustomCommand tags: - { name: redaktilo.command } acme_redaktilo.custom_search_strategy: class: Acme\RedaktiloBundle\Search\SearchStrategy tags: - { name: redaktilo.search_strategy, priority: 20 }
注意:
SearchStrategy
的优先级是可选的(默认为 0)。优先级越高,SearchEngine
越早检查SearchStrategy
是否支持给定的模式。
安装
使用 Composer 安装此包
composer require gnugat/redaktilo-bundle:^1.0
然后在您的内核中注册此包。例如
<?php // File: app/AppKernel.php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { return array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Gnugat\RedaktiloBundle\GnugatRedaktiloBundle(), ); } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); } }
使用 Symfony2 DependencyInjection 组件独立使用
如果您不使用完整框架,而只是使用 Symfony2 DependencyInjection 组件,您仍然可以使用此包
<?php use Gnugat\RedaktiloBundle\DependencyInjection\CommandCompilerPass; use Gnugat\RedaktiloBundle\DependencyInjection\SearchStrategyCompilerPass; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\HttpKernel\DependencyInjection\Extension; $container = new ContainerBuilder(); $fileLocator = new FileLocator(__DIR__.'/vendor/gnugat/redaktilo/Resources/config'); $loader = new YamlFileLoader($container, $fileLocator); $loader->load('services.yml'); $container->addCompilerPass(new SearchStrategyCompilerPass()); $container->addCompilerPass(new CommandCompilerPass());
更多信息
您可以使用以下方法查看当前和过去的版本
- 使用
git tag
命令 - 在 Github 的版本页面
- 列出版本之间更改的文件
您可以在以下链接中找到更多文档