0
.Quickの質問 - 私は、次の作業の構文があります。私のPHPTAL構文に何が間違っていますか?
<td tal:define="owner record/owner_id; user user/id; mode php:(owner eq user)?'_edit':'_view'; linkname php:(owner eq user)?'Edit':'View';">
<a href="index.php?-table=${table}&-action=${mode}&id=${record/id}">${linkname}</a>
</td>
を私が使用できるように期待していた短い:
ためにowner
と
user
を定義する必要がない、すなわち
<td tal:define="mode php:(record.owner_id eq user.id)?'_edit':'_view';linkname php:(record.owner_id eq user.id)?'Edit':'View';">
<a href="index.php?-table=${table}&-action=${mode}&id=${record/id}">${linkname}</a>
</td>
php:
試験のためにそれらに得るために。
私の質問は、どのようにphp:
コンテキストでドット構文が間違っているのですか?テンプレート内のPHPを変更せずに、これを表現する簡単な方法がありますか?