For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > March 2004 > deferenced object call parsing problem (PHP5)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author deferenced object call parsing problem (PHP5)
Jochem Maas

2004-03-19, 1:28 pm

hello people,

I have a problem with accessing methods of dereferenced objects e.g.
(getValue() returns an object.)

{$Field->getValue()->getName()}

unfortunately Smarty_Compiler.class.php dies telling me its found an
unindentified tag; which sucks!

I have been trying to hack the Smarty_Compiler.class.php
(around line 164) in order to change the regular expression to allow
such syntax (and still allow arguments in each method call e.g.
$Field->getValue($x)->getName() )

I have had no luck.

Does anyone have a patch for this? any hints? Has anyone else had this
problem and/or tried to get it to work?

Can anyone say if this is expected to be 'fixed'**?

Hopefully I won't have to litter my templates with assign tags just to
get round this. e.g.

{assign var=Obj value=$Field->getValue()}
{$Obj->getName()}

regards,

Jochem.

---
** I realise this is not something that is broken per se, but it would
be great if the parser supported the new dereferenced syntax.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com