Skip to content

Commit

Permalink
Merge pull request #301 from WouterJ/xml_support
Browse files Browse the repository at this point in the history
Added XML support
  • Loading branch information
Wim Vandersmissen committed May 8, 2014
2 parents 18b30bd + 7b8a1e3 commit 09dd5c3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function getConfigTreeBuilder()
$rootNode = $treeBuilder->root('kuma_admin');

$rootNode
->fixXmlConfig('admin_locale')
->children()
->scalarNode('dashboard_route')->end()
->arrayNode('admin_locales')
Expand Down
16 changes: 16 additions & 0 deletions DependencyInjection/KunstmaanAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,20 @@ public function prepend(ContainerBuilder $container)
$configs = $container->getExtensionConfig($this->getAlias());
$this->processConfiguration(new Configuration(), $configs);
}

/**
* {@inheritDoc}
*/
public function getNamespace()
{
return 'http://bundles.kunstmaan.be/schema/dic/admin';
}

/**
* {@inheritDoc}
*/
public function getXsdValidationBasePath()
{
return __DIR__.'/../Resources/config/schema';
}
}
18 changes: 18 additions & 0 deletions Resources/config/schema/admin-1.0.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns="http://bundles.kunstmaan.be/schema/dic/admin"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://bundles.kunstmaan.be/schema/dic/admin"
elementFormDefault="qualified">

<xsd:element name="config" type="config" />

<xsd:complexType name="config">
<xsd:sequence>
<xsd:element name="admin-locale" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>

<xsd:attribute name="admin-locale" type="xsd:string" />
<xsd:attribute name="default-admin-locale" type="xsd:string" />
</xsd:complexType>

</xsd:schema>

0 comments on commit 09dd5c3

Please sign in to comment.