mirror of
https://github.com/KnpLabs/KnpMarkdownBundle.git
synced 2024-06-29 02:40:10 +02:00
Allow user to define his own parser classes
This commit is contained in:
parent
68170b74e8
commit
f4bdb13b19
|
@ -13,6 +13,11 @@ class MarkdownExtension extends Extension
|
|||
{
|
||||
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
|
||||
$loader->load('parser.xml');
|
||||
|
||||
if(isset($config['class']))
|
||||
{
|
||||
$container->setParameter('markdown.parser.class', $config['class']);
|
||||
}
|
||||
}
|
||||
|
||||
public function helperLoad($config, ContainerBuilder $container)
|
||||
|
|
|
@ -14,6 +14,11 @@ Optionnally enable the twig markdown filter :
|
|||
twig.config: ~ # Enable Twig
|
||||
markdown.twig: ~ # Enable the markdown filter
|
||||
|
||||
You can also define your own Parser class :
|
||||
|
||||
markdown.parser:
|
||||
class: Bundle\HelloBundle\MarkdownParser
|
||||
|
||||
## USAGE
|
||||
|
||||
// Use the service
|
||||
|
|
Loading…
Reference in a new issue