Re: [PHPTAL] default macro file

2009-02-10 Thread Kornel Lesiński
On 30.01.2009, at 18:09, romtek wrote: On Fri, Jan 30, 2009 at 4:57 AM, Kornel Lesiński > wrote: On 30-01-2009 at 03:13:16 romtek wrote: Assuming that unwinding when handling exceptions is more time consuming than using if/else mechanism, wouldn't it be better to build this ability into

Re: [PHPTAL] default macro file

2009-01-30 Thread romtek
On Fri, Jan 30, 2009 at 4:57 AM, Kornel Lesiński wrote: > On 30-01-2009 at 03:13:16 romtek wrote: > > Assuming that unwinding when handling exceptions is more time consuming >> than using if/else mechanism, wouldn't it be better to build this ability >> into >> PHPTAL? >> > > Yes, exceptions ar

Re: [PHPTAL] default macro file

2009-01-30 Thread Kornel Lesiński
On 30-01-2009 at 03:13:16 romtek wrote: Assuming that unwinding when handling exceptions is more time consuming than using if/else mechanism, wouldn't it be better to build this ability into PHPTAL? Yes, exceptions are slower, but it doesn't make noticeable difference unless you make thous

Re: [PHPTAL] default macro file

2009-01-29 Thread romtek
On Tue, Jan 27, 2009 at 6:12 AM, Kornel Lesiński wrote: > > This works only for external macros. I've just committed improved exception > handling that allows fallback for local macro names: > > class MyTemplateFramework extends PHPTAL { >public function executeMacro($path) >{ >

Re: [PHPTAL] default macro file

2009-01-27 Thread Levi Stanley
Sweet, that is even better. Best regards, Levi Stanley Kornel Lesiński wrote: > On 26-01-2009 at 19:53:39 Levi Stanley wrote: > >> admirau: >> >> class MyTemplateFramework extends PHPTAL { >> private $default_macro_file; >> public function setDefaultFile($default_macro_file){ >>$

Re: [PHPTAL] default macro file

2009-01-27 Thread Kornel Lesiński
On 26-01-2009 at 19:53:39 Levi Stanley wrote: admirau: class MyTemplateFramework extends PHPTAL { private $default_macro_file; public function setDefaultFile($default_macro_file){ $this->default_macro_file; } public function executeMacro($path){ if (preg_match

Re: [PHPTAL] default macro file

2009-01-26 Thread Levi Stanley
admirau: class MyTemplateFramework extends PHPTAL { private $default_macro_file; public function setDefaultFile($default_macro_file){ $this->default_macro_file; } public function executeMacro($path){ if (preg_match('/^(.*?)\/([a-z0-9_]*)$/i', $path, $m)){

[PHPTAL] default macro file

2009-01-26 Thread admirau
Hello, It would be very helpful to have something like default macro file. I know, that people asked for this feature before. For example: when only name of the macro is specified, and this macro is not found in current file, look for this macro in default template file. $tpl->setDefaultMacroFi