Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Mojolicious templates

by moritz (Cardinal)
on Apr 30, 2013 at 16:06 UTC ( #1031426=note: print w/replies, xml ) Need Help??


in reply to Mojolicious templates

One popular alternative is to put templates in the __DATA__ section of Mojolicious::Lite apps.

Replies are listed 'Best First'.
Re^2: Mojolicious templates
by darutoko (Initiate) on Apr 30, 2013 at 16:26 UTC
    How your comment could help me? I don't understand.

    1-st I've wrote 'Mojolicious' not 'Mojolicious::Lite'
    2-nd If you wold look at http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Layouts you would see that even in __DATA__ section layout is under 'layouts/' path.

    So please if you don't know any thing - don't write.
      1-st I've wrote 'Mojolicious' not 'Mojolicious::Lite'

      And Mojolicious::Lite is in the Mojolicious distribution. So without prior knowledge it's not obvious that you are excluding ::Lite.

      2-nd If you wold look at http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Layouts you would see that even in __DATA__ section layout is under 'layouts/' path.

      But it's not in a layouts directory, which you asked about.

      Maybe if you gave use more background information (why is it so terrible to have layouts in the path? What do you want to achieve?) it would be easier for us to help you.

      Anyway, grepping through the Mojolicious sources, I found only one place that hard-codes the path layouts, and that's in Mojolicious::Renderer method _extends. If you care enough, you can replace that method via monkey patching.

      Or maybe you can store your templates somewhere else by using a simple symlink.

      If you like to behave like Kraih Himself, I'd say you better go and read the code to find out.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031426]
help
Chatterbox?
[marto]: it makes things less stressful for the parents that's for sure :P
[Corion]: Yeah (although their mother was somewhat stressed out regardless) - but it made for an otherwise relaxed evening ;)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2016-12-08 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (139 votes). Check out past polls.