I
I
itmalex2019-01-11 14:32:35
Slim Framework
itmalex, 2019-01-11 14:32:35

Routing for multilingualism in Slim Framework 3. How to implement?

$app->group('/{lang}', function() use($app){
    $app->group('/backend', function() use ($app){
        $app->get('', 'BackendController:index');
        $app->get('/pages', 'BackendController:pages');
        $app->get('/newPage', 'BackendController:newPage');

        $app->post('/newPage', 'BackendController:newPageAdd');
    });

    $app->get('', 'SiteController:index');
});

Let's say if I don't want language prefixes in urls to be used for the default language, how can I implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eternalfire, 2019-01-11
@eternalfire

condition if {lang} is the one you don't want to display - $app->group('/{lang}' is not needed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question