如何在yii html视图文件中编写模型函数


How to write model function in yii html view file

我正在研究yii旧版本我需要在视图文件中编写模型函数这个文件是html格式,我不知道如何调用模型函数。我需要将这个值{{ $model->customers_charge->shop_id }}发送给模型函数

我的代码是:
{{foreach $models model}}
              <tr>
                <td>{{date('M/d/Y H:i', strtotime($model.created))}}</td>
                <td>{{if $model->deposit>0}}{{$model->deposit}}{{/if}}</td>
                <td>{{if $model->deposit<0}}{{$model->deposit*-1}}{{/if}}</td>
                <td>
                {{if $model->memo eq Order}}
                Shopping Order 
                {{else}}
                {{$model->memo|ucwords}}                
                {{/if}}
                </td>
              </tr>
              {{/foreach}}  

如何在Yii框架中获取模型函数。谁能好心地指点我一下吗?我期待你宝贵的回复。

你就不能这么做吗?

YourModelName::model()->YourFunction($arg1,$arg2);

$model = new YourModelName();
$model->YourFunction($arg1,$arg2);

还是我错过了什么?