FAQ
"Kyle" == Kyle Hall writes:
Kyle> Thanks to Bill and David the info. I'm still learning how to use
Kyle> Catalyst, it's almost overwhelming when compared to CakePHP ( which is
Kyle> what I started with as my first framework ) here is what I've got:

Kyle> My button: <a href="[% c.uri_for('/help', c.action ) %]"
Kyle> class="button" id="menu-help">Help</a>

Kyle> My Help controller:
Kyle> sub index : Chained('/') PathPart('help') Args {
Kyle> my ( $self, $c, @path ) = @_;

Kyle> my $path = join('/', @path);

Kyle> $c->stash->{template} = "help/$path.tt";
Kyle> }

Kyle> Seems to work fine. Any suggestions for improvements?

Is there any non-static content in the help files? If not, you can get
away with serving the plain files straight from root/help via:

--8<---------------cut here---------------start------------->8---

MyApp->config->{'Plugin::Static'}{dirs} = [ 'help' ];

--8<---------------cut here---------------end--------------->8---

As usual you'll want to serve that straight via apache or whatever in
production.

And in your templates:

--8<---------------cut here---------------start------------->8---

<a href="[% c.uri_for('/help', c.req.path) %]"/>Help</a>

--8<---------------cut here---------------end--------------->8---

--
Eden Cardim Need help with your Catalyst or DBIx::Class project?
Code Monkey http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://blog.edencardim.com/ http://www.shadowcat.co.uk/servers/

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 9 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 31, '11 at 4:12p
activeMay 10, '11 at 12:35p
posts9
users7
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase