Dhtmlx touch and smarty template .tpl

Hello!
I am new to Dhtmlx touch, but i am trying to include it on my mobile version of website.
I have seen many tutorials and dhtmlx examples which are very useful but they use html as index page.
Actually i am interested on using smarty template (.tpl) with dhtmlx and i am having problems.
I would be very grateful if you help me on providing some examples using smarty tpl with dhtmlx.
I am writing some code here where i have to use dhtmlx /js script instead of

tags.
The question is : Could it be possible to use foreach loop of smarty tpl syntax OR using some js loop inside of dhtmlx to search through $_COMMENTS that comes from a php file.

{foreach item=_COMM from=$_COMMENTS }

{$_COMM.comments} {$_COMM.owner} {$_COMM.createdtime} {/foreach}

Thanks in advance

In case of dhtmlx-touch it will be better to separate data and ui, so on page instead of data you can have

dhx.ui({view:“list”, url:“data.php”});

where data.php will provide data in one of possible format (json, xml, csv) where you can use any php templating techniques.