Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Catalyst::View::TT and PROVIDERS

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


omega at palle

Apr 28, 2008, 4:09 AM

Post #1 of 2 (1157 views)
Permalink
Catalyst::View::TT and PROVIDERS

Hello

I try to use Template::Provider::Encoding, to make usage of utf-8
encoded templates easier. The problem is that to make it work nicely,
I need to do something with Catalyst::View::TT. The issue is that I
need to tell the PROVIDER about INCLUDE_PATH, but the INCLUDE_PATH
gets set after all the PROVIDERS are done initializing, and thus any
$c->stash->{additional_template_paths} gets lost.

I have created a patch (attached) that extends the View::TT PROVIDERS
config-key a bit, and also reorders the constructor a little.

The net benefit is that the PROVIDER initialization code now can copy
config-keys from the main config, and when it copies INCLUDE_PATH, it
copies the one with the coderef, which ends in
additional_template_paths working when I use the Encoding-provider.

- andreas
Attachments: catalyst-view-tt-reorder.diff (5.24 KB)


marcus at nordaaker

Apr 30, 2008, 3:53 AM

Post #2 of 2 (1072 views)
Permalink
Re: Catalyst::View::TT and PROVIDERS [In reply to]

On 28. april. 2008, at 13.09, Andreas Marienborg wrote:

> Hello
>
> I try to use Template::Provider::Encoding, to make usage of utf-8
> encoded templates easier. The problem is that to make it work
> nicely, I need to do something with Catalyst::View::TT. The issue is
> that I need to tell the PROVIDER about INCLUDE_PATH, but the
> INCLUDE_PATH gets set after all the PROVIDERS are done initializing,
> and thus any $c->stash->{additional_template_paths} gets lost.
>
> I have created a patch (attached) that extends the View::TT
> PROVIDERS config-key a bit, and also reorders the constructor a
> little.
>
> The net benefit is that the PROVIDER initialization code now can
> copy config-keys from the main config, and when it copies
> INCLUDE_PATH, it copies the one with the coderef, which ends in
> additional_template_paths working when I use the Encoding-provider.

Applied. Catalyst-View-TT 0.27 on it's way to CPAN.

Marcus

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.