[Catalyst] How to trail the .html files in my control
Vidya Sagar
vsagarkola at gmail.com
Fri Feb 17 16:53:07 CET 2006
hi all ,
in my template i have written
[%c.request.base%]/page/terms_conditions.html.
given below code is written in maypole can i use for catalyst .
if i use where can i put this in my shop.pm or Shop/V/TT.pm
sub parse_path {
my $self = shift;
# remove the trailing .html for any path other than starting with
/page/
$self->{path} =~ s/\.html$// if $self->{path} !~ /^page\//;
$self->SUPER::parse_path(@_);
}
This is not the whole code but a part of it and here is my TT.pm
package Shop::V::TT;
use strict;
use base 'Catalyst::View::TT';
use HTML::Entities;
sub new {
my $self = shift;
$self->config->{WRAPPER} = 'wrapper';
$self->config->{COMPILE_DIR} = '/var/www/Shop/ttc';
$self->config->{FILTERS} = {html_entity =>
\&Shop::V::TT::html_encode_entities},
$self->config->{CONTEXT} = undef; # it will disable profiling of
templates
$self->config->{ERROR} = 'error';
return $self->SUPER::new(@_);
}
Now in my browser, whenever i connect to any link in my web page it is
taking only html files, but my problem is that it should take the method
which is in .pm file- as html file and direct to the concerned html file.
kindly please help me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060217/e427cb7d/attachment.htm
More information about the Catalyst
mailing list