Fix line endings?

This commit is contained in:
Tim 2021-07-21 00:25:37 +02:00
parent d20f7401c1
commit da8a1e37ca
4 changed files with 758 additions and 758 deletions

View File

@ -1,41 +1,41 @@
<?php
namespace Ardent\ParameterBundle\Controller;
use Ardent\ParameterBundle\Service\ParameterService;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class ParameterController extends BaseController
{
/**
* @Route("/{category}", name="parameter_bundle_parameters")
*/
public function parameters($category = 'categories',
ParameterService $param,
Request $request)
{
$configs = $param->getConfig();
// Handle all special cases for the name
if ('categories' === $category) { // List all the categories
$categories = [];
foreach ($configs as $key => $config) {
$categories[] = $key;
}
$categories[] = 'all';
return $this->render('@ArdentParameter/categories.html.twig', ['categories' => $categories]);
} elseif ('all' === $category) { // Show all parameters from all categories
$allConfigs = [];
foreach ($configs as $config) {
$allConfigs = array_merge($allConfigs, $config);
}
return parent::baseIndex($param, $request, $allConfigs);
} else { // Show the parameters from one category
return parent::baseIndex($param, $request, $configs[$category]);
}
}
<?php
namespace Ardent\ParameterBundle\Controller;
use Ardent\ParameterBundle\Service\ParameterService;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class ParameterController extends BaseController
{
/**
* @Route("/{category}", name="parameter_bundle_parameters")
*/
public function parameters($category = 'categories',
ParameterService $param,
Request $request)
{
$configs = $param->getConfig();
// Handle all special cases for the name
if ('categories' === $category) { // List all the categories
$categories = [];
foreach ($configs as $key => $config) {
$categories[] = $key;
}
$categories[] = 'all';
return $this->render('@ArdentParameter/categories.html.twig', ['categories' => $categories]);
} elseif ('all' === $category) { // Show all parameters from all categories
$allConfigs = [];
foreach ($configs as $config) {
$allConfigs = array_merge($allConfigs, $config);
}
return parent::baseIndex($param, $request, $allConfigs);
} else { // Show the parameters from one category
return parent::baseIndex($param, $request, $configs[$category]);
}
}
}

View File

@ -1,38 +1,38 @@
<?php
namespace Ardent\ParameterBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public const TYPE_TEXT = 'text';
public const TYPE_NUMBER = 'number';
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ardent_parameter');
$treeBuilder->getRootNode()
->children()
->arrayNode('parameters')
->arrayPrototype()
->arrayPrototype()
->children()
->scalarNode('name')->end()
->enumNode('type')
->values([self::TYPE_TEXT, self::TYPE_NUMBER])
->defaultValue(self::TYPE_TEXT)
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
<?php
namespace Ardent\ParameterBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public const TYPE_TEXT = 'text';
public const TYPE_NUMBER = 'number';
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ardent_parameter');
$treeBuilder->getRootNode()
->children()
->arrayNode('parameters')
->arrayPrototype()
->arrayPrototype()
->children()
->scalarNode('name')->end()
->enumNode('type')
->values([self::TYPE_TEXT, self::TYPE_NUMBER])
->defaultValue(self::TYPE_TEXT)
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
}

1346
LICENSE

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
{% extends '@ArdentParameter/layout.html.twig' %}
{% block par_user_content %}
<h2>Parameter categories</h2><br>
{% for category in categories %}
<a class="btn-primary btn" href="{{ path('parameter_bundle_parameters', {category:category}) }}">{{ category }}</a><br><br>
{% endfor %}
{% extends '@ArdentParameter/layout.html.twig' %}
{% block par_user_content %}
<h2>Parameter categories</h2><br>
{% for category in categories %}
<a class="btn-primary btn" href="{{ path('parameter_bundle_parameters', {category:category}) }}">{{ category }}</a><br><br>
{% endfor %}
{% endblock %}