[PHPTAL] Patch for Configuration Methods

2008-04-07 Thread Werner
Hi Kornel (and everyone else) Herewith a patch for PHPTAL configuration methods. It adds very little new functionality - the main aim of these new methods is to simplify PHPTAL's integation into third party frameworks like Zend Framework, Symfony, etc. The secondary aim was 100% backward comp

[PHPTAL] Cache options from PHP

2008-04-07 Thread B. Kamer
Hi, just been introduced to phptal as an template engine and am investigating it... Would it be possible to set caching options not from within the template but rather from PHP? I need to be able to do this because the engine that utilizes the template engine decides the caching options?

Re: [PHPTAL] Cache options from PHP

2008-04-07 Thread Werner
Hi! This should be fairly easy. You can set caching as a per-element condition (if I understand your approach correctly) and cache it accordingly by making use of tal:condition. E.g, try something like this: ...in your code: $instance->cache_h3 = true; ...and in your template (note the us

Re: [PHPTAL] Cache options from PHP

2008-04-07 Thread B. Kamer
Thanks but, this would mean that i still need to set caching properties within the template... I need to set caching options without a need for special markup... setSource is a phptal method, so something like; $instance = new PHPTal(); $templateSource = '' . file_get_contents($tpl_file

Re: [PHPTAL] Cache options from PHP

2008-04-07 Thread Kornel Lesinski
On 7 Apr 2008, at 12:11, B. Kamer wrote: Would it be possible to set caching options not from within the template but rather from PHP? I need to be able to do this because the engine that utilizes the template engine decides the caching options? I've added such possiblity — check latest S

Re: [PHPTAL] Patch for Configuration Methods

2008-04-07 Thread Kornel Lesinski
On 7 Apr 2008, at 08:50, Werner wrote: Herewith a patch for PHPTAL configuration methods. It adds very little new functionality - the main aim of these new methods is to simplify PHPTAL's integation into third party frameworks like Zend Framework, Symfony, etc. The secondary aim was 100%

Re: [PHPTAL] Cache options from PHP

2008-04-07 Thread Christoph Frick
On Mon, Apr 07, 2008 at 03:34:23PM +0100, Kornel Lesinski wrote: > $phptal->set('cache_duration', 3); // variable's value must be integer > ... > $phptal->set('cache_duration', "3 h"); // variable's value must be integer ... i hope this is allowed too? otherwise, the original requeester st

Re: [PHPTAL] Cache options from PHP

2008-04-07 Thread Kornel Lesinski
On Mon, 07 Apr 2008 15:53:56 +0100, Christoph Frick <[EMAIL PROTECTED]> wrote: $phptal->set('cache_duration', "3 h"); // variable's value must be integer ... i hope this is allowed too? No, it's not allowed (I don't want to check syntax at run time). otherwise, the original requeeste

Re: [PHPTAL] Patch for Configuration Methods

2008-04-07 Thread Joshua Paine
On Mon, 2008-04-07 at 09:50 +0200, Werner wrote: > the patch enables a fluent interface for many access methods. Maybe I missed something, but it looks like you enabled method chaining, not a fluent interface, which uses method chaining to make a sort of DSL. Method chaining is useful for cutting

Re: [PHPTAL] Patch for Configuration Methods

2008-04-07 Thread Werner
Hi Joshua Agreed. Thanks for pointing that out. I guess the term got more generalized along the way as method chaining implementations started popping up everywhere. Btw: Nice reference! Kind Regards, Werner Joshua Paine wrote: it looks helpful here, it's just not "fluent".