<? php
$PCollection = new \Phalcon\Mvc\Micro\Collection();
// config global
$Allow_Regex = $this->getShared('config')->project->regex;
$PCollection
// VERSION NUMBER SHOULD BE FIRST URL PARAMETER, ALWAYS
->setPrefix('/v1')
// Must be a string in order to support lazy loading
->setHandler('\NAppRest\App\Controllers\AppController')
->setLazy(true);
/**
*
* Select Project Database
*
*/
$PCollection->get('/', 'getIndex');
$PCollection->post('/', 'getIndex');
// project
$PCollection->get('/{projectName:'.($Allow_Regex).'}', 'getProjectInfo');
$PCollection->post('/{projectName:'.($Allow_Regex).'}', 'getProjectInfo');
$PCollection->get('/{projectName:'.($Allow_Regex).'}/table', 'getTableDirect');
...
i want to set one time this : "/{projectName:'.($Allow_Regex).'}"
for all collection !
is that possible ?
mean :
<?php
$PCollection->get('/', 'getProjectInfo');
$PCollection->post('/', 'getProjectInfo');
$PCollection->get('/table', 'getTableDirect');
i dont want repeat that every time !
any idea ?
thanks !