[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] ::TT ::AnyTemplate and ::TemplateRunner template file name discovery


> ::Plugin::TT and ::Plugin::AnyTemplate and ::Plugin::TemplateRunner all
> offer to guess the file name of the template for you. Ruby on Rails and
> other Hot New MVC frameworks do this, too.
>
> So maybe there's something to it.
>
> But all three of the CGI::App plugins that do this differently.

I'm glad you brought this up, because it's something that was bugging me
about AnyTemplate, that it only provides the one strategy for guessing
the template path.

>  AnyTemplate will just use the run mode, so:
>      form_display.html
>
>   This doesn't scale on its own. If I have two sub-projects that use
>   forms, I have a collision. A workaround could be to set the
>   tmpl_path() for sub-projects that use the same run mode name.

This is what we use in the CAF (per-application template path), so this
is what went in to AnyTemplate.

>  TT will use the current package name, so:
>      My/App/form_display.html
...
>  TemplateRunner will use the URL, so: myapp.cgi/really/rocks.html
>  Becomes:
>      really/rocks.html

I like both of these strategies as well.

Maybe CAP::TemplatePath should be its own plugin, and the user could
choose strategies at runtime?


Michael


--
Michael Graham <suppressed>



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.