Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Mojolicious templates

by darutoko (Initiate)
on Apr 30, 2013 at 15:11 UTC ( #1031421=perlquestion: print w/replies, xml ) Need Help??
darutoko has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to use layout outside of 'layouts' directory?

Replies are listed 'Best First'.
Re: Mojolicious templates
by moritz (Cardinal) on Apr 30, 2013 at 16:06 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 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 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.
Re: Mojolicious templates
by davido (Archbishop) on Apr 30, 2013 at 20:44 UTC

    This question would be answered definitively in between 15 seconds and 10 minutes on channel #mojo.


      Well, it wasn't answered even in 2 hours on #mojo channel.
      But I've already solved it yesterday.
      Thanks for another useless comment, Dave.

        I honestly didn't intend for my suggestion to be useless, and I'm sorry you viewed it as such. I've found the #mojo channel to be the "where to go for Mojolicious answers" place, and since I saw that you hadn't received an answer here, suggested it in a hope that you would get your answer somewhere. Another option is the Mojolicious email list, which also tends to get answers pretty quickly. Both of those places are frequented by the Mojolicious development team. I don't recall seeing the Mojolicious development team replying to questions here at the Monastery. Wouldn't you agree that it's helpful to know where the core developers are providing authoritative answers?

        If you prefer not to receive such help I'll try to remember in the future, though I tend to forget rudeness pretty quickly -- those sorts of people come and go too frequently, and rarely contribute anything interesting or positively memorable.


        It would be nice if you posted your solution here for future reference. There might be others in the same situation.
        لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1031421]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-03-20 21:57 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (259 votes). Check out past polls.