Provides the following services from Redaktilo in a Symfony2 application:
redaktilo.editor
: an instance ofGnugat\Redaktilo\Editor
Documentation:
- Extending
- Installation
- Usage with Symfony2 DependencyInjection Component standalone
- Further documentation
You can also extend
Redaktilo by creating new SearchStrategy
and new Command
.
To make your custom Command
and SearchStrategy
available, simply define them
as services in your Symfony2 application and tag them:
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 }
Note:
SearchStrategy
's priority is optionnal (defaults to 0). The higher the priority is, the soonerSearchEngine
will check if theSearchStrategy
supports the given pattern.
Use Composer to install the bundle:
composer require gnugat/redaktilo-bundle:^1.0
Then register the bundle in you kernel. For example:
<?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');
}
}
If you're not using the full stack framework, but rather just the Symfony2 DependencyInjection Component, you can still use this bundle:
<?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());
You can see the current and past versions using one of the following:
- the
git tag
command - the releases page on Github
- the file listing the changes between versions
You can find more documentation at the following links: