[Maypole] (no subject)

Peter Speltz peterspeltz@yahoo.com
Fri, 19 Nov 2004 20:27:29 -0800 (PST)


--- Simon Flack <sf@flacks.net> wrote:


> IMO, the model shouldn't be affecting the view like that. That seems like
> presentation logic that belongs in a custom view or perhaps the controller.
> Here's one way of doing it as a custom view:
> 
>     package MyView; # or whatever
>     use base 'Maypole::View::TT';
>     use File::Spec;
> 
>     sub paths {
>         my ($self, $r) = @_;
>         my @paths = $self->SUPER::paths($r);
>         my $platform = 'web';
>         if ($ENV{USER_AGENT} =~ /Nokia|Motoroloa|.../) {
>             $platform = 'mobile';
>         }
>         return map File::Spec->catdir($_, $platform), @paths
>     }
> 

> There are other ways of doing this in the existing framework, for example, 
> by overriding Maypole::get_template_root().

 You're right. Override paths method or get_template_root works great for
everything i was worried about but one thing. Thank you. Sorry for wasting time
on that.

The one thing is ADDING ADDITIONAL EXTERNAL LIBRARIES to paths that your
templates in "template_root" will use, I'm still not sure Maypole allows for
this as well as it should. Only way i could do it was to override paths which
is rather extreme just to add something to INCLUDE_PATH. I'm not complaining ,
just giving my 2 cents as a user. :)  Hopefully you'll again show me maypole
does just what i want.  

 
> _______________________________________________
> maypole mailing list
> maypole@lists.netthink.co.uk
> http://lists.netthink.co.uk/listinfo/maypole
> 


=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com