While developing, you can see which templates are rendered on screen, with either:
$ morbo script/yourapp.pl $ MOJO_LOG_LEVEL=debug perl script/yourapp.pl daemon You will then see something like this in the log: [Wed Jun 3 10:39:22 2015] [debug] Rendering template "index.html.ep" [Wed Jun 3 10:39:22 2015] [debug] Rendering template "partials/nav.html.ep" [Wed Jun 3 10:39:22 2015] [debug] Rendering template "partials/footer.html.ep" [Wed Jun 3 10:39:22 2015] [debug] GET "/" Note that if nothing appears to STDERR, then it's probably because you have "./log" directory. On Monday, May 18, 2015 at 11:45:42 AM UTC+2, Juergen Nickelsen wrote: > > On 14.05.2015 04:11, Justin Hawkins wrote: > > >> for a while I have been trying to get at the name of the template that > >> is just being rendered, to use it in the layout. > > > > I can’t answer your question directly, but this requirement sounds like > > a bit of a code smell. What are you trying to accomplish? > > Oh, I understand your suspicion. What I want to have is just an > informational comment in the rendered page that says which template has > rendered that page, like this: > > <!-- template v_m_s/domains.html.ep --> > > As I said, I am a novice with Mojolicious and "serious" web > applications, plus my application is (at this stage of development) > akind of twisty little maze of pages, of which some are, while not > actually redundant, relatively similar. At some point I was actually > wondering which template had rendered the page I was looking at, hence > that idea. > > I could easily put that line by hand into each template to achieve the > same effent (or even devise a scheme to have that done automatically), > but as Mojolicious is great at avoiding boilerplate, I thought it should > be able to come up with a generic solution. > > It is certainly not something that will be needed for production code. > > Regards, Juergen. > > -- > <juergen.nickel...@fu-berlin.de> Tel +49.30.838-50740 Fax -450740 > Zentraleinrichtung fuer Datenverarbeitung, Central Systems (Unix) > Freie Universitaet Berlin, Fabeckstrasse 32, 14195 Berlin, DE > -- 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 post to this group, send email to mojolicious@googlegroups.com. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.