Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

ghenry's scratchpad

by ghenry (Vicar)
on Mar 29, 2005 at 13:32 UTC ( #443123=scratchpad: print w/ replies, xml ) Need Help??

How to produce random page titles in Catalyst:

=head2 auto # # A list titles, which will be # randomly used for each page title # # i.e. <title>[% page_title %]</title> # =cut sub auto : Private { my ( $self, $c ) = @_; my @titles = qw{ Test1 Test2 Test3 Test4 }; my $rand_title = $titles[ rand @titles ]; $c->stash->{page_title} = $rand_title; return 1; }
Put this in your MyApp.pm

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (22)
As of 2015-07-01 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (6 votes), past polls