Replies: 1 comment 1 reply
-
|
That's a tricky one but I have a guess. Try routing to action "foo" not "Foo". I suspect it isn't making it to the action but then auto rendering the template based on the lower casing of the action name. You can check this by putting an explicit log message in your controller, which I suspect you won't see; or by renaming the template to something not equal to the action name and using that name in render, that would break the automatic rendering and you'd get a 404 or something (I'm not at my computer to test right now) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
From the tutorial-Stash and templates: the stash example works fine. However in the full mojo app where in MyApp.pm:
$r->get('/foo')->to('example#Foo');and in the controller, Example.pm:
sub foo ($c) { $c->stash(one => 23); $c->render(template => 'foo', two => 24); }and foo.html.eps:
The magic numbers are <%= $one %> and <%= $two %>.I get the error msg: Global symbol "$one" requires explicit package name (did you forget to declare "my $one"?) at template example/Foo.html.ep line 1. and the same for $two.
This is in the environment: strawberry-perl 32, Win10 and Mojolicious 9.19
Where have I gone wrong?
Beta Was this translation helpful? Give feedback.
All reactions