Here is a piece of smarty code of an older project.
PHP Code:
{section name="x" loop=$txt}
{assign_by_ref var="catid" value=$txt[x].id_cat}
{$txt[x].date_online|date_format:"%d-%m-%Y"}
<a href="index.php?tpl=text&id_cat={$catid[0]}&id_doc={$txt[x].id_doc}">{$txt[x].title}</a>
{if $txt[x].logo}
<img src="attach/docs/doc/{$txt[x].folder}/{$txt[x].logo}" width="{$txt[x].width}" height="{$txt[x].height}">
{/if}
{if $txt[x].head}
<p>{$txt[x].head|strip_typo_bb:"latestarttext"}(...)</p>
{elseif $txt[x].text}
<p>{$txt[x].text|strip_typo_bb:"latestarttext"}(...)</p>
{/if}
{section name="dcat" loop=$catid}
{op_doccat_branch id_cat=$catid[dcat] fields="id_cat,title" name="branch"}
{section name=c loop=$branch}
<a href="index.php?tpl=cat&id_cat={$branch[c].id_cat}">{$branch[c].title|strip_num}</a>
{/section}
{/section}
{/section}
Any designer who can handle such a piece of code should be able to handle any piece of php code in templates.
The designer i work with on new projects have to work with php in templates. There is no discussion about that.
I can recommend to each designer who starts with his career to learn basic php. It's strange to focus on a second language layer who's advantage, if it exsists, is so minimalistic.
Bookmarks