[PHPTAL] Help calling date function in tag?
Miko Väli
mikovali at gmail.com
Sun Apr 26 21:54:50 CEST 2009
It's a php! modifier so you should use php syntax there.
This should work:
<p class="pubdate">Published <span tal:replace="php: date('A, B e, Y',
data['publication_date'])" /></p>
Jason La wrote:
> I'm trying to call the date() function in a tag, but with no luck. Any
> help would be much appreciated.
>
> Assume that $data['publication_date'] is defined and sent to PHPTAL
> througn ->set('data', $data);
>
> <p class="pubdate">Published <span tal:replace="php: date('A, B e, Y',
> ${data/publication_date})" /></p>
>
> I'm getting:
>
> exception 'PHPTAL_ParserException' with message 'Invalid TALES path:
> '$ctx->data/$ctx->publication_date', expected variable name' in
> E:\htdocs\website\public\library\phptal\PHPTAL\Php\TalesInternal.php:164
>
> I tried this as well, but that doesn't work either because it is
> looking for separate paths for both data and publication_date.
>
> <p class="pubdate">Published <span tal:replace="php: date('A, B e, Y',
> data/publication_date)" /></p>
>
> ===============
> Jason La
> jasonla at gmail.com
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
More information about the PHPTAL
mailing list