| CatalystX-Features documentation | Contained in the CatalystX-Features distribution. |
CatalystX::Features::View::Mason - Makes View::Mason know about features
version 0.20
package MyApp::View::Mason; use base 'CatalystX::Features::View::Mason';
Use this base class to make View::Mason support Mason in your features.
Just make MyApp::View::Mason inherit from this class to put mason files
under your feature's /root.
Appended to the feature /root dir.
<CatalystX::Features> <simple.feature> mason_prefix mason mason_prefix more_mason </simple.feature> </CatalystX::Features>
Rodrigo de Oliveira (rodrigolive), C<rodrigolive@gmail.com>
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
| CatalystX-Features documentation | Contained in the CatalystX-Features distribution. |
package CatalystX::Features::View::Mason; $CatalystX::Features::View::Mason::VERSION = '0.20'; use strict; use warnings; use base 'Catalyst::View::Mason'; sub new { my ( $self, $app, $arguments ) = @_; $arguments->{comp_root} = [ [ 'root' => $app->config->{root} ] ]; foreach my $feature ( $app->features->list ) { my $prefix = $app->features->config->{ $feature->name }->{mason_prefix} || ''; if ( ref $prefix eq 'ARRAY' ) { my $cnt; for ( @{$prefix} ) { $cnt++; my $id = $feature->id . "-$cnt"; push( @{ $arguments->{comp_root} }, [ $id => Path::Class::dir( $feature->root, $prefix )->stringify ] ); } } else { push( @{ $arguments->{comp_root} }, [ $feature->id => Path::Class::dir( $feature->root, $prefix )->stringify ] ); } } $self->next::method( $app, $arguments ); }
1;