Re: [PHPTAL] Re: Access values in PHPTal modifiers?

2009-06-14 Thread Kornel Lesiński
On 13.06.2009, at 21:47, Igor Sverkos wrote: With the phptal_tale() function (note the missing "s") I can achieve to write little phptal functions, which will act as wrappers for my PHP functions. This will really ends in a much more readable template and I can use the fancy array syntax l

[PHPTAL] Re: Access values in PHPTal modifiers?

2009-06-13 Thread Igor Sverkos
Kornel Lesiński writes: > > Could you explain to me, why I should write and use a custom > > phptal_tale()function, when I could do the same by just calling PHP > > directly (php: myFunction(value))? > > Sure, you can use php: expressions if that suits you. > > Expression modifiers are syntact

Re: [PHPTAL] Re: Access values in PHPTal modifiers?

2009-06-09 Thread Kornel Lesiński
On 08-06-2009 at 18:41:10 Igor Sverkos wrote: phptal_tales_myDate() is called at compile time only. It should not return the date (because there isn't any value yet), but code that will generate the date at run time. phptal_tales() returns code that will evaluate to the value. return 'd

[PHPTAL] Re: Access values in PHPTal modifiers?

2009-06-08 Thread Igor Sverkos
Hi, Kornel Lesiński wrote: > Sorry, I've rushed with the answer. > > phptal_tales_myDate() is called at compile time only. It should not return > the date (because there isn't any value yet), but code that will generate > the date at run time. > > phptal_tales() returns code that will evalua

Re: [PHPTAL] Re: Access values in PHPTal modifiers?

2009-06-02 Thread Kornel Lesiński
On 02-06-2009 at 18:14:27 Igor Sverkos wrote: $value = phptal_tales($src,$nothrow); >$result = date('o-m-d H:i:s', $value); >return '"' . $result . '"'; > } Hmm.. doesn't work for me. After the phptal_tales() call, $value has the value: (string:31) phptal_path($ctx->item, 'date')

[PHPTAL] Re: Access values in PHPTal modifiers?

2009-06-02 Thread Igor Sverkos
Hello, Kornel Lesiński writes: > > and write a custom modifier like > > > > function phptal_tales_myDate($src, $nothrow) > > { > > $value = ??? > > $value = phptal_tales($src,$nothrow); > > > $result = date('o-m-d H:i:s', $value); > > return '"' . $result . '"'; > > } Hmm.. doesn't