Re: [PHPTAL] Template lastModified time

2008-11-17 Thread Maciej Łebkowski
On Mon, Nov 17, 2008 at 11:09, Kornel Lesiński
[EMAIL PROTECTED] wrote:
 There's no method for it, but it's easy to add it. In PHPTAL class add:
[...]
 This will give time of main template. If you want time for all templates,
 you'll need to change executeMacro() or setConfigurationFrom() methods.

Looks great. Here`s the patch (not tested yet): http://pastie.org/316798


-- 
Maciej Łebkowski, http://lebkowski.info/kontakt.php
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] Dynamic macros

2008-10-21 Thread Maciej Łebkowski
Hello,

Sometimes its comfortable to generate macros from dynamic data.
Is there any way to use macros from memory instead of files?

For now, it seems that this code works:

   tal:block metal:use-macro=$dynamic/test /

$dynamic is a data-uri, i.e. data://text/plain;base64, . base64_encode(macro)

Together with new PHPTAL_DataSource, attached in PHPTAL_FileSourceResolver:

+$parsed = parse_url($path);
+if (data == $parsed['scheme']) {
+return new PHPTAL_DataSource($path);
+}

(PHPTAL_DataSource implementation isn`t interesting at all)


I dont know if there are any drawbacks — cache, optimisation, etc?

Or maybe I am missing some fundamential concepts?

Any comments?

-- 
Maciej Łebkowski, http://lebkowski.info/kontakt.php
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal