Correct, if it works in any sense it's accidental. -Dan
On Sun, Mar 15, 2020 at 11:39 PM Stefan Adams <s1037...@gmail.com> wrote: > Thanks, Dan! Does that mean, then, that what I provided as a solution is > actually a bad idea and may not always work as I'm anticipating? > > On Sun, Mar 15, 2020, 9:41 PM Dan Book <gri...@gmail.com> wrote: > >> 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 <s1037...@gmail.com> 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 mojolicious+unsubscr...@googlegroups.com. >>> 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 mojolicious+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/mojolicious/CABMkAVUZDdegns3wRWojpXJX15vePVtY%3DvRkfh-RKyar88JPxw%40mail.gmail.com >> <https://groups.google.com/d/msgid/mojolicious/CABMkAVUZDdegns3wRWojpXJX15vePVtY%3DvRkfh-RKyar88JPxw%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 mojolicious+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFRjaVzGikOFOAWuLX2%2BbGU5GjsD%3DDX3p_B4WEcS9WxOAg%40mail.gmail.com > <https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFRjaVzGikOFOAWuLX2%2BbGU5GjsD%3DDX3p_B4WEcS9WxOAg%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 mojolicious+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/CABMkAVW9tQr1N9Gx_y%2BF6YMJj%2BZU2hCFF%2BMt9OOOZSi4qzN-tw%40mail.gmail.com.