For sure, that’s what I’ll go with for now. Thank you for taking the time
to create this reply and suggestion.
IMO, this seems a little bit rigid for Mojo. I thought about something like
this (it's a bad idea, just sharing):
push @{app->layout->paths}, qw(mobile desktop);
But trying to specify which template you want would be awkward.
% layout 'mobile/default.html.ep';
Is silly because Mojo would have to break the path and reassemble it.
Meanwhile:
% layout 'desktop/layouts/default.html.ep';
Defeats the purpose of having an array of paths, since you're already
specifying the full path.
So in summary, maybe a way of specifying a layout with a fuller (not full)
path? Maybe you could indicate you could indicate you want to go outside
the default layout directory by adding a '/' at the beginning, to specify
the top of the templates directory (not the storage root:
% layout 'desktop/layouts/default.html.ep';
would open
templates/
├── layouts
│ └── desktop
│ └── default.html.ep
But:
% layout '/desktop/layouts/default.html.ep';
Would open:
templates/
├── desktop
│ └── layouts
│ └── default.html.ep
Just a thought, probably not much call for it, but there it is.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.