[Catalyst] HOWTO reference config settings from template

Jason Kohles email at jasonkohles.com
Thu Apr 12 19:47:51 GMT 2007

On Apr 12, 2007, at 1:01 PM, Jeff Chimene wrote:

> The config is called in the View package (fori::View::Menu) I was  
> hoping to set TT2 values /per package/ via the config as created by  
> the TT2 helper. It looks like (after DEBUG => 'all') that TT2 only  
> references the stash when it resolves variables.
What is the problem you are trying to solve?  Changing the template  
processor configuration from within a template that it is currently  
processing doesn't seem wise to me.

That being said, the reason that only the stash variables are  
accessible is because they are all that are provided to TT by default...

package MyApp::View::TT;

sub template_vars {
	my ( $self, $c ) = @_;

	my %vars = $self->SUPER::template_vars( $c );

	$vars{ 'ttconfig' } = $self->config;

	return %vars;

Jason Kohles
email at jasonkohles.com
"A witty saying proves nothing."  -- Voltaire

More information about the Catalyst mailing list