Hi,

we added namespace support to our library.

So

,-[ Old class ]-.
¦ <?php         ¦
¦ class My_Foo  ¦
¦ {}            ¦
`---------------´

became

,-[ New class ]--.
¦ <?php          ¦
¦ namespace My;  ¦
¦ class Foo      ¦
¦ {}             ¦
`----------------´

Some classes have constants, which are accessed from a template

,---------------------------------------[ Old template 
]---------------------------------------.
¦ <tal:block tal:condition="php: 
date_filter.isFilterApplied(My_Foo::TODAY)">Today</tal:block> ¦
`----------------------------------------------------------------------------------------------´

We changed it into

,------------------------------------[ Migrated template v1 
]------------------------------------.
¦ <tal:block tal:condition="php: 
date_filter.isFilterApplied(\My\Foo::TODAY)">Today</tal:block>  ¦
`------------------------------------------------------------------------------------------------´

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

,-----------------------------------[ Migrated template v2 
]-----------------------------------.
¦ <tal:block tal:condition="php: 
date_filter.isFilterApplied(My\Foo::TODAY)">Today</tal:block> ¦
`----------------------------------------------------------------------------------------------´

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

Reply via email to