On Tue, 2009-06-02 at 11:05 +0200, Zbigniew Lukasiak wrote:

> Just one idea - in the TT view there is a
> http://search.cpan.org/~mramberg/Catalyst-View-TT-0.29/lib/Catalyst/View/TT.pm#DYNAMIC_INCLUDE_PATH
> option.  

This is exactly what we used in this situation, as mentioned before we
have wrapper classes with use lib/base to get at the shared code and
then in the shared base controller we setup the alternate TT search
paths.

sub apath : Chained('/') : CaptureArgs(0) {     
    my ( $self, $c ) = @_;
    $c->stash->{'additional_template_paths'} =
['/path/to/shared/templates'];
    return 1; 
}

The good thing about this for us is that we can override the path in the
child controller.

sub apath : PathPart('different/path') Chained('/') CaptureArgs(0) {
    my ( $self, $c ) = @_;
    $self->NEXT::apath($c);
}

This has allowed us to have the same code for a number of sites with
different urls and site specific stuff kept in the respective child
controllers.

Iain.


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to