gnugat / redaktilo-bundle

提供 Redaktilo 编辑器和 TextFactory 作为服务

安装: 213

依赖项: 0

建议者: 0

安全: 0

星标: 6

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

v1.5.2 2015-12-01 17:48 UTC

This package is auto-updated.

Last update: 2024-09-05 20:00:23 UTC


README

Redaktilo 中提供以下服务,用于 Symfony2 应用程序

文档

SensioLabsInsight Travis CI

扩展

您还可以通过创建新的 SearchStrategy 和新的 Command 来扩展 Redaktilo。

要使您的自定义 CommandSearchStrategy 可用,只需在您的 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 的版本页面
  • 列出版本之间更改的文件

您可以在以下链接中找到更多文档