2012-02-06 55 views
0
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"; 
    } 

數組值,如果我在控制器設置$這 - >查看 - > arrErrors = $ arrErrors, 能否訪問它通過$ this-> arrErrors [ 'CLIENT_NAME'〕中的視圖?訪問鑑於

+0

或我將其設置爲$這 - >查看 - > arrErrors [ 'CLIENT_NAME'] = $ arrErrors [」客戶名稱']; – Micheal 2012-02-06 19:09:48

回答

0

我爲一個愚蠢的問題aplogize。

這裏是正確的方法:

$this->view->arrErrors=arrErrors['client_name']; 

使用上述代碼在控制器