난 ... 내 심포니 양식 요청에서 데이터를 제대로 결합하지 않는 이유를 이해하는 데 어려움이심포니 양식 바인딩 문제 : 빈 배열
액션 :
public function executeSendEmail(sfWebRequest $request)
{
$history_id = $request->getParameter('id');
if($request->isMethod(sfRequest::POST))
{
print_r("POST");
$this->form = new SendEmailForm();
$this->form->bind($request->getParameter('email_form'));
print_r($request->getParameter('email_form'));
if(!$this->form->isBound())
die('!isBound()');
print_r($this->form->getValues());
if($this->form->isValid())
{
die('form is Valid!');
}
die('after isValid...');
}
die('redirect !');
$this->redirect('history/show?id='.$history_id);
}
양식 클래스 : 행동 입력시
class SendEmailForm extends sfForm
{
public function setup()
{
$this->setWidgets(array(
'author' => new sfWidgetFormInputText(),
'email' => new sfWidgetFormInputText(),
'subject' => new sfWidgetFormInputText(),
'body' => new sfWidgetFormTextarea(),
));
$this->setValidator('email', new sfValidatorEmail());
$this->widgetSchema->setLabels(array(
'author' => 'Autor',
'email' => 'E-mail',
'subject' => 'Tytuł',
'body' => 'Treść wiadomości'
));
$this->widgetSchema->setNameFormat('email_form[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
parent::setup();
}
}
$request->getParameter('email_form')
가 포함
Array (
[author] => RRr
[email] => [email protected]
[subject] => rrrr
[body] => rrrr
[_csrf_token] => 73881c1b6217e221c4d25c065ec93052)
그래서 올바른 것으로 보이지만 $this->form->getValues()
이 빈 배열()을 반환하고 왜 그 이유가 알 수 없기 때문에 바인딩에 실패합니다. 제안 사항이 있으십니까? Thx를 미리