【发布时间】:2014-04-15 19:44:01
【问题描述】:
我正在尝试向开源程序添加新功能。所以文档很少,这部分是使用 smarty 用 php OOP 编写的。我会尽量保持简单。
我正在尝试复制 href 以调用类中的方法。 href 看起来像这样:
<td style="border-style:none;">
<a id="multiprintToFax" href="{$CONTROLLER}prescription&multiprintfax&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='Fax'})</span></a>
</td>
这是工作程序的一部分。我试图通过这样做来复制调用函数/方法:
<td>
<a id="Re_Issue_rx" href="{$CONTROLLER}prescription&Re_Issue_rx" onclick="top.restoreSession()" class="css_button"><span>{xl t='Re-Issue'} ({xl t='Rx'})</span>
</a>
</td>
我像这样在 Prescription 类文件中设置了一个方法
function Re_Issue_rx(){
return 'Issued';
}
我收到一条错误消息:
The action trying to be performed: Re_Issue_rx does not exist controller: Prescription
既然这是错误的,那么从 Prescription 类调用方法/函数的正确方法是什么?
【问题讨论】: