Утро,Zend Form Validator foreach
У меня есть странная проблема с Zend Form Validator. Когда я хочу вывести сообщения об ошибках, я вижу: ArrayArray.
Мой код:
<?php
// Load sms request form
$smsRequestForm = new Application_Form_Sms_Request();
// Form posted?
if ($this->getRequest()->getMethod() != 'POST') {
// Show the form
$this->view->showForm = true;
$this->view->smsRequestForm = $smsRequestForm;
} elseif (!$smsRequestForm->isValid($_POST)) {
// Show the form and output the validation errors
$this->view->showForm = true;
$this->view->smsRequestForm = $smsRequestForm;
// Loop through the error messages
foreach($smsRequestForm->getMessages() as $message)
{
echo $message;
}
} else {
}
Я читать документы и узнал, что эхо $ сообщения; должен выводить ошибку в текстовом виде.
Выполнение foreach ($ smsRequestForm-> getMessages() как $ key => $ message); не решает мою проблему.
Кто-нибудь знает, что я делаю неправильно?
Заранее благодарен!