我正在使用 symfony 1,问题是当我使用 RenderPartial 函数将小部件放入弹出窗口时,出现以下错误:
注意:未定义变量:第 49 行 ...templates/template.php 中的表单
致命错误:第 49 行 .../templates/template.php 中的非对象调用成员函数 open()
这是我在 class.php 中的函数:
public function executeProduct(sfWebRequest $request)
{
$this->renderPartial('integrate/Product');
$form = new ProductForm();
if ($request->isMethod('post') && $request->hasParameter($form->getName()))
{
$form->bindRequest($request);
if ($form->isValid())
{
$form->save();
return $this->redirectBack();
}
$this->forms['product'] = $form;
}
else
{
foreach ($form->getGlobalErrors() as $nom=>$error)
{
echo $nom.':'.$error;
}
}
}
我能做些什么来解决这个问题?