朝、
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 {
}
ドキュメントを読んで、echo $message; であることを知りました。エラーメッセージをプレーンテキストで出力する必要があります。
foreach($smsRequestForm->getMessages() as $key => $message); を実行します。私の問題を解決しません。
私が間違っていることを誰かが知っていますか?
前もって感謝します!