Open bbankowski opened 9 years ago
Remove except
option from allowAll()
(which should also be removed) - one less regexp.
Remove allowAll()
from docs.
Replace regexps with strstr()
where possible.
If route does not contain parameters just check if ($this->getUri() == $uri)
maybe Route::group()
should really group route rules and evaluate them only if the prefix matches.
That way we could group routes in our app and have less rules to evaluate.
We should definitely implement Route::group()
and Route::resource()
as aggregates.
I replaced one allowAll with 7 routes in panel. If we removed all allowAlls we would have roughly 29x7 more routes in panel.
change routes parsing to prefix tree. console ouzo:routes -g should generate a file with a prefix tree.
/customers /customers/add /customers/add/comment /customers/search /customers/:id /customers/:id/add_product/:prod_id
$a = [
'GET' => [
'customers' => [
'/' => 'customers#index',
'add' => [
'/' => 'customers#add',
'comment' => 'customers#add_comment'
],
'search' => 'customer_searches#search',
':param' => [
'name' => 'id',
'children' => [
'/' => 'customers#show',
'add_product' => [
':param' => [
'name' => 'prod_id',
'children' => [
'/' => 'customer_products#add'
]
]
]
]
]
]
]
];
e.g.