Welcome Guest, Not a member yet? Register   Sign In
merge empty placeholders in routing
#1

Is it possible to merge routes with and without placeholders? If the placeholder is empty, the Method gets called with $1 = null (or any other placeholders)
PHP Code:
$routes->post('save', 'BlogController::SavePost');

$routes->post('save/(:any)''BlogController::SavePost/$1'); 
The first one could be removed.
It is easier to search the internet than posting a question. So, yes, I am asking because I did not find the answer anywhere else.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB