I have the following code in zend:
$arrErrors=array();
if (!empty($this->post['submit']))
{
// Each time theres an error, add an error message to the error array
// using the field name as the key.
if (empty($this->post['client_name']))
$arrErrors['client_name'] = "Please Enter Client's name as it appears in the carrier software";
}
如果我在控制器中设置$ this-> view-> arrErrors = $ arrErrors, 我可以在视图中以$ this-> arrErrors ['client_name']的形式访问它吗?
答案 0 :(得分:0)
这是正确的方法:
$this->view->arrErrors=arrErrors['client_name'];
在控制器中使用上述代码