theman | 12 Jan 2010 14:23
Gravatar

Re: How to disabe ${php: XXXX} forced echo?


That's unfortunate and something I feel needs addressed. Thanks for the
answer.

On Tue, 12 Jan 2010 09:56:45 +0000, Kornel Lesinski
<kornel@...> wrote:
> On 11 Jan 2010, at 21:07, <theman@...>
<theman@...>  
> wrote:
> 
>> Is there anyway to prevent PHPTAL from automatically echoing the  
>> result of
>> ${php: XXXX}?
> 
> There's no explicit way to do it. You could wrap call in function that  
> returns nothing (e.g. substr(XXXX,0,0)).
> 
>> I have integrated PHPTAL with Zend Framework and Dojo but
>> have an issue when attempting to use dojo().onLoadCaptureStart().
>>
>> // inline-content.tpl.html
>> <tal:block>
>> ${helper: dojo().onLoadCaptureStart()}
>> 	function _initLoader() {
>> 		dojo.parser.parse(dojo.body());
>> 		dojo.fadeOut({
>> 			node: "loader",
>> 			duration: 420,
>> 			onEnd: function() {
>> 				dojo.byId('loader').style.display = "hidden";
>> 				dojo.byId('layoutContent').style.display = "inherit";
>> 			}
>> 		}).play(25);
>> 	}
>> ${helper: dojo().onLoadCaptureEnd()}
> 
> Does Dojo expect to get HTML/XML markup as input, or unescaped script?  
> If the latter, you might get nasty surprise when you use '&' or '<'.
> 
>> Oh, while I'm thinking
>> about it, is there a way to do multi-line ${} tags so I don't have  
>> to have
>> such a long line? Something like:
>>
>> ${structure helper:
>>  dojo().requireModule('dojo.parser')
>>        .requireModule('dijit.Form')}
> 
> 
> I could add that.

Gmane