GET /something =\Controllers\main->something
// index.php
$f3->ONERROR = function($f3) {
$ml = Multilang::instance();
if ($ml->auto && $f3->VERB=='GET' && isset($f3->ROUTES[ $new = '/'.$ml->current.$f3->PATH ])) {
if ($f3->QUERY)
$new .= '?'.$f3->QUERY;
$f3->reroute($new);
}
};
// index.php
$paths = array_keys($f3->ROUTES);// store the initial paths, before the plugin instantiates
$ml = Multilang::instance();
if ($ml->auto)
foreach ($paths as $path) {
$new = '/'.$ml->current.$f3->PATH;
if ($f3->QUERY)
$new .= '?'.$f3->QUERY;
$f3->redirect('GET '.$f3->PATH,$new,FALSE);
}