[jifty-devel] search for 'blah/index.html' in T::D path as well
as Mason path
Jesse Vincent
jesse at bestpractical.com
Wed Mar 14 16:34:48 EDT 2007
On Wed, Mar 14, 2007 at 08:26:23PM +0000, Edmund von der Burg wrote:
> Getting to grips with how Jifty handles templates I think that I have
> found an inconsistency:
>
> This is all in Jifty/Dispatcher.pm (revision 2963):
>
> in _do_show (line 769) there is a bit of code that adds '/index.html'
> to the end of the template path if there is template component that
> would match that. This is tested using 'template_exists'.
>
> However 'template_exists' (line 1150) only checks for Mason templates,
> it does not check for T::D templates. Should template_exists be
> changed to:
>
> sub template_exists {
> my $self = shift;
> my $template = shift;
>
> return
> Jifty->handler->declare_handler->template_exists($template)
> || Jifty->handler->mason->interp->comp_exists($template);
> }
>
> This would check for TD templates first. As the 'render_templates'
> tries to use a T::D template first this behaviour would be more
> consistent.
>
Go for it.
> Also would it not be better to check for the existance of a template
> component first and then only add the '/index.html' to the end if one
> is not found? As T::D components do not need to map to file names in
> the same way that Mason ones do this might prevent some unexpected
> behaviour.
Yes. Go for it.
>
>
> Cheers,
> Edmund.
>
>
> --
> In reality I'm evdb at ecclestoad.co.uk - http://ecclestoad.co.uk
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
--
More information about the jifty-devel
mailing list