Fix line endings?
This commit is contained in:
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user