我在一个页面上有 2 个表单,我想单独验证。
我有以下内容:
public function executeNew(sfWebRequest $request)
{
$this->propertyForm = new AdminNewPropertyForm();
$this->propertyCsvForm = new AdminNewPropertyImportForm();
$this->processForm($request, $this->propertyForm, $this->propertyCsvForm);
}
protected function processForm(sfWebRequest $request, sfForm $propertyForm, sfForm $propertyCsvForm)
{
if($request->hasParameter('property'))
{
if($request->isMethod('post'))
{
$propertyForm->bind($request->getParameter($propertyForm->getName()));
if($propertyForm->isValid())
{
$propertyForm->save();
$this->getUser()->setFlash('success', 'The property was successfully updated.');
} else {
$this->getUser()->setFlash('error', 'The property could not be saved.');
}
}
}
else {
if($request->isMethod('post'))
{
$propertyCsvForm->bind($request->getParameter($propertyCsvForm->getName()));
if($propertyCsvForm->isValid())
{
$propertyCsvForm->save();
}
}
}
}
然后我在视图中显示这两种形式。
问题是,我在传递表格时遇到错误processForm()
Strict standards: Declaration of propertyActions::processForm() should be compatible with that of autoPropertyActions::processForm()
我是否正确传递了表格?
谢谢