[Catalyst] remove the trailing .html for any path
Vidya Sagar
vsagarkola at gmail.com
Thu Feb 16 16:37:40 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(@_);
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(@_);
}
please any one suggest me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060216/4f147f4a/attachment.htm
More information about the Catalyst
mailing list