Re: [PHPTAL] Accessing namespaces from templates

2010-07-08 Thread Kornel Lesiński

On 08-07-2010 at 13:50:27 Thomas D.  wrote:


which will end in a "...unexpected T_NS_SEPARATOR..." error.

So how do we do that? Isn't that currently possible, because PHPTal  
hasn't got namespace support? Do we need to use the experimental PHPTal  
version

with explicit namespace support?


You don't need that experimental version. The problem is only in code  
parser for php: modifier, which has been extended to allow namespaces  
after 1.2.1 was released. So you version newer than 1.2.1 (try 1.2.2b or  
SVN).


The fix is trivial, so if you prefer sticking to stable version, you can  
modify PHPTAL_Php_Transformer::isVarNameChar() and add '\\' as allowed  
character there.


--
regards, Kornel

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] Accessing namespaces from templates

2010-07-08 Thread Thomas D.
Hi,

we added namespace support to our library.

So

,-[ Old class ]-.
¦ Today ¦
`--´

We changed it into

,[ Migrated template v1 
].
¦ Today  ¦
`´

which will end in a "unexpected T_VARIABLE, expecting T_STRING" error,

,---[ Migrated template v2 
]---.
¦ Today ¦
`--´

which will end in a "...unexpected T_NS_SEPARATOR..." error.

So how do we do that? Isn't that currently possible, because PHPTal hasn't
got namespace support? Do we need to use the experimental PHPTal version
with explicit namespace support?

 
-- 
Regards,
Thomas


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal