Morning,
I have a strange problem with the Zend Form Validator. When I want to output the error messages I see: ArrayArray.
My code:
<?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 {
}
I've read the docs and learned that echo $message; should output the errormessage in plain text.
Doing foreach($smsRequestForm->getMessages() as $key => $message); does not solve my problem.
Does anyone know what I'm doing wrong?
Thanks in advance!