Re: [Templates] TT in callback

[prev] [thread] [next] [Date index for 2005/01/03]

From: Arshavir Grigorian
Subject: Re: [Templates] TT in callback
Date: 21:55 on 03 Jan 2005
Perrin Harkins wrote:

>On Mon, 2005-01-03 at 14:13 -0500, Arshavir Grigorian wrote:
>  
>
>>I have a package subroutine that requires an Apache request object and 
>>will return a list of privileges (based on a session id stored in 
>>pnotes). So I am wondering whether I should be using TT's Plugin 
>>interface to make this subroutine accessible from within a template 
>>(make it a class), or whether there is a better way for doing this.
>>    
>>
>
>I would just get the list of privileges before running the template and
>pass them in as data.
>
>  
>
I thought about that, but it would mean passing this data to every page, 
then code every page to relay it to the toolbar library template on each 
include. I would like to avoid doing this especially since almost all 
the pages need this toolbar.

I was thinking that if I could make the toolbar template a self 
sufficient component, then the regular pages/templates would just 
include it and have it do its own thing, instead of having to relay data 
from their own process calls.

$tt->process('sample_page.html', { data => $data_for_sample_page,
                                   priveleges => \@priveleges });

sample_page.html
----------------------
[% INCLUDE toolbar $priveleges %]


for each page on the system.


>>If the Plugin is the way to go, would I have to initialize the Template 
>>object to contain a reference to the Apache request object, then use it 
>>from within the template that includes the plugin?
>>    
>>
>
>If you need a request object in a plugin, just get it by calling
>Apache->request().  That will work fine unless you're using threads.
>  
>
Thanks. This makes sense.

>- Perrin
>
>  
>


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

[Templates] TT in callback
Arshavir Grigorian 19:13 on 03 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 21:14 on 03 Jan 2005

Re: [Templates] TT in callback
Arshavir Grigorian 21:55 on 03 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 22:02 on 03 Jan 2005

Re: [Templates] TT in callback
Arshavir Grigorian 22:39 on 03 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 23:21 on 03 Jan 2005

Re: [Templates] TT in callback
Michael Peters 14:21 on 04 Jan 2005

Re: [Templates] TT in callback
Sean T Allen 14:46 on 04 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 15:48 on 04 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 11:26 on 05 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 15:18 on 05 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 11:08 on 06 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:34 on 06 Jan 2005

Re: [Templates] TT in callback
Harry Jackson 10:39 on 07 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 14:02 on 07 Jan 2005

Re: [Templates] TT in callback
Bill Moseley 16:11 on 07 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 16:23 on 07 Jan 2005

Re: [Templates] TT in callback
Bill Moseley 19:22 on 08 Jan 2005

Re: [Templates] TT in callback
C. Chad Wallace 18:05 on 07 Jan 2005

Re: [Templates] TT in callback
Tony Bowden 00:14 on 04 Jan 2005

Re: [Templates] TT in callback
Cees Hek 02:38 on 04 Jan 2005

Re: [Templates] TT in callback
merlyn (Randal L. Schwartz) 02:48 on 04 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:55 on 04 Jan 2005

Re: [Templates] TT in callback
Cees Hek 22:18 on 04 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 23:54 on 04 Jan 2005

Re: [Templates] TT in callback
Cees Hek 02:39 on 05 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 10:59 on 05 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:40 on 04 Jan 2005

Re: [Templates] TT in callback
Arshavir Grigorian 22:16 on 07 Jan 2005

RE: [Templates] TT in callback
Jason Gottshall 22:29 on 05 Jan 2005

Re: [Templates] TT in callback
Mark Mills 22:46 on 05 Jan 2005

RE: [Templates] TT in callback
Simon Matthews 15:58 on 06 Jan 2005

RE: [Templates] TT in callback
Larry Leszczynski 19:44 on 06 Jan 2005

RE: [Templates] TT in callback
Simon Matthews 16:53 on 07 Jan 2005

RE: [Templates] TT in callback
Perrin Harkins 17:05 on 07 Jan 2005

Re: [Templates] TT in callback
Buddy Burden 23:52 on 07 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 05:18 on 05 Jan 2005

Re: [Templates] TT in callback
Cees Hek 05:48 on 05 Jan 2005

TT Caching (Was: Re: [Templates] TT in callback)
Larry Leszczynski 17:18 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 18:07 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 18:28 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Larry Leszczynski 18:18 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 19:15 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Octavian Rasnita 19:00 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
merlyn (Randal L. Schwartz) 19:14 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Octavian Rasnita 07:29 on 06 Jan 2005

Re: [Templates] TT in callback
Tony Bowden 15:05 on 06 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 15:50 on 06 Jan 2005

Re: [Templates] TT in callback
Tony Bowden 09:09 on 07 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 19:14 on 06 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Octavian Rasnita 20:32 on 06 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 21:14 on 06 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:44 on 08 Jan 2005

Re: [Templates] TT in callback
Bill Moseley 20:09 on 08 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 04:42 on 10 Jan 2005

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52