gnugat / redaktilo-bundle
Provides Redaktilo's Editor and TextFactory as services
Installs: 216
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/gnugat/redaktilo-bundle
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
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
Extending
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 soonerSearchEnginewill check if theSearchStrategysupports the given pattern.
Installation
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'); } }
Usage with Symfony2 DependencyInjection Component standalone
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());
Further documentation
You can see the current and past versions using one of the following:
- the
git tagcommand - the releases page on Github
- the file listing the changes between versions
You can find more documentation at the following links: