mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
bootstrap api and apply on accompanying period
This commit is contained in:
@@ -106,8 +106,7 @@ class CRUDRoutesLoader extends Loader
|
||||
protected function loadCrudConfig($crudConfig): RouteCollection
|
||||
{
|
||||
$collection = new RouteCollection();
|
||||
$controller = $crudConfig['controller'] === CrudController::class ?
|
||||
'cscrud_'.$crudConfig['name'].'_controller' : $crudConfig['controller'];
|
||||
$controller ='cscrud_'.$crudConfig['name'].'_controller';
|
||||
|
||||
foreach ($crudConfig['actions'] as $name => $action) {
|
||||
// defaults (controller name)
|
||||
@@ -144,8 +143,7 @@ class CRUDRoutesLoader extends Loader
|
||||
protected function loadApiSingle(array $crudConfig): RouteCollection
|
||||
{
|
||||
$collection = new RouteCollection();
|
||||
$controller = $crudConfig['controller'] === ApiController::class ?
|
||||
'cscrud_'.$crudConfig['name'].'_controller' : $crudConfig['controller'];
|
||||
$controller ='csapi_'.$crudConfig['name'].'_controller';
|
||||
|
||||
foreach ($crudConfig['actions'] as $name => $action) {
|
||||
// filter only on single actions
|
||||
@@ -160,7 +158,7 @@ class CRUDRoutesLoader extends Loader
|
||||
|
||||
// path are rewritten
|
||||
// if name === 'default', we rewrite it to nothing :-)
|
||||
$localName = '_entity' === $name ? '' : $name;
|
||||
$localName = '_entity' === $name ? '' : '/'.$name;
|
||||
$localPath = $action['path'] ?? '/{id}'.$localName.'.{_format}';
|
||||
$path = $crudConfig['base_path'].$localPath;
|
||||
|
||||
|
Reference in New Issue
Block a user