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

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


Over lunch I firmed up my thinking about this. 

On 2005-07-12, Mark Stosberg <suppressed> wrote:
> But all three of the CGI::App plugins that do this differently. Here's a
> summery of the strategies used, with commentary:
>
>  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.

I prefer this approach for its straightforward simplicity. It will work
for small projects without creating extra empty directories. Bigger
projects may need to declare a tmpl_path() and here to avoid collisions. 

    Mark

>   -----------------------------------------------
>
>  TT will use the current package name, so:
>      My/App/form_display.html
>
>   This might be too verbose. It would be nice to trim off the 'My' 
>   directory level, since absolutely everything might be under My/App.
>
>   It is prone to collisions if two instance scripts use the same module,
>   but want to have different templates. Again, that can be addressed 
>   with tmpl_path(), (That's what tmpl_path is for). 
>
>   -----------------------------------------------
>
>  TemplateRunner will use the URL, so: myapp.cgi/really/rocks.html
>  Becomes:
>      really/rocks.html
>
>  With this design, you can manage the verbosity of the directory
>  structure and your collisions by how you structure your URLs.
>  But the strength could also be a weakness if minor URL tampering
>  causes the template not be found. 
>
>   -----------------------------------------------



---------------------------------------------------------------------
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.