Mojolicious does not support dynamic routing. Once a route has matched, the only thing an under can determine is if the dispatch chain continues or stops.
-Dan On Sun, Mar 15, 2020 at 10:28 PM Stefan Adams <[email protected]> wrote: > I'm wanting to dynamically set the controller in, for example, an under > > my $admin = $self->routes->under('/admin' => sub { ... }); > > > The only way I have found is like so > > my $admin = $self->routes->under('/admin' => sub { > shift->match->stack->[-1]->{controller} = 'something'; > }); > > > Is this the right way? The best way? The only way? > > I could have sworn it was possible to set the controller in an under by > simply setting it in the stash, but that is not working for me. > > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFTGpPNNfc5E9oPj-KzV6nD4-%3DBXQHyz-iJHwoeWCi3bjg%40mail.gmail.com > <https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFTGpPNNfc5E9oPj-KzV6nD4-%3DBXQHyz-iJHwoeWCi3bjg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/CABMkAVUZDdegns3wRWojpXJX15vePVtY%3DvRkfh-RKyar88JPxw%40mail.gmail.com.
