<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>If it's a TT file you need (i.e., not static), along with appropriate processing, you can make a variation on Ben's suggestion by using the $c-&gt;request-&gt;arguments, and putting the file name into&nbsp;$c-&gt;stash-&gt;{template} before handing off to the TT view, which is likely to be the default. This is a slight variation on ben's suggestion, which will only hit the file system when looking at the right part of the URI space.&nbsp;</div><div><br></div><div>I've not tested this, but it'd just look something like:</div><div><br></div><div>sub dynamic : Local {</div><div>&nbsp;&nbsp;my ($self, $c) = @_;</div><div>&nbsp;&nbsp;my $args =&nbsp;$c-&gt;request-&gt;arguments();</div><div>&nbsp;&nbsp;$c-&gt;stash-&gt;{template} = join('/', @$args);</div><div>};</div><div><br></div><div>This omits the error handling (assumes TT will take care of that) but should only handle requests that begin /dynamic. The arguments() method returns additional stuff after "/dynamic" in the requesting URL.&nbsp;</div><div><br></div><div>I do something similar in my code (it's not precisely the same, as I retrieve the file contents through a model) and it works pretty well for us.&nbsp;</div><div><br></div><div>For security, you probably want to remove stuff like "..", just to be safe.&nbsp;</div><div><br></div><div>All the best</div><div>Stuart</div><div><br></div><br><div><div>On 2010-10-11, at 11:14 AM, Ben van Staveren wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>The other way to do it (and this is hackish), would be something like this:<br><br>...<br></div></blockquote><br><blockquote type="cite"><div>This is, however, very non-optimal since you are hitting the filesystem for every request that wasn't satisfied by an existing action. Like I said, you can either let the webserver serve up static pages. If you are worried about how the URL looks in the browser, some mod_rewrite magic will fix that for you, but that's a subject for another list :)<br><br>...<br> <br>Anthony Gladdish wrote:<br><blockquote type="cite"><font class="Apple-style-span" color="#540000"><br></font></blockquote><blockquote type="cite">I want to add quite a few .tt2 pages to the app, in various directories.<br></blockquote><blockquote type="cite">I don't want to have to create a Controller action per added template page ( this is the only way I know of adding a web page to a Catalyst app ).<br></blockquote><blockquote type="cite">Every time I add a new page I'll have to add a new action to represent that page then restart the server. There must be a way to add as many template pages as required, and have a single Controller action display the web page if it's corresponding template exists, otherwise 404.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">...</blockquote><br>-- <br>Ben van Staveren<br>phone: +62 81 70777529<br>email: <a href="mailto:benvanstaveren@gmail.com">benvanstaveren@gmail.com</a><br></div></blockquote></div><br></body></html>