mirror of
https://github.com/KnpLabs/KnpMarkdownBundle.git
synced 2024-06-29 02:40:10 +02:00
55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Bundle\MarkdownBundle\DependencyInjection;
|
|
|
|
use Symfony\Component\DependencyInjection\Extension\Extension;
|
|
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
|
|
class MarkdownExtension extends Extension
|
|
{
|
|
|
|
public function parserLoad($config, ContainerBuilder $container)
|
|
{
|
|
$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)
|
|
{
|
|
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
|
|
$loader->load('helper.xml');
|
|
}
|
|
|
|
public function twigLoad($config, ContainerBuilder $container)
|
|
{
|
|
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
|
|
$loader->load('twig.xml');
|
|
}
|
|
|
|
/**
|
|
* Returns the base path for the XSD files.
|
|
*
|
|
* @return string The XSD base path
|
|
*/
|
|
public function getXsdValidationBasePath()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public function getNamespace()
|
|
{
|
|
return 'http://www.symfony-project.org/schema/dic/symfony';
|
|
}
|
|
|
|
public function getAlias()
|
|
{
|
|
return 'markdown';
|
|
}
|
|
|
|
}
|