本文整理汇总了PHP中BaseForm::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseForm::getName方法的具体用法?PHP BaseForm::getName怎么用?PHP BaseForm::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseForm
的用法示例。
在下文中一共展示了BaseForm::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processForm
protected function processForm(sfWebRequest $request, BaseForm $form)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid()) {
$schedule = $form->save();
$this->getUser()->setFlash('notice', $form->isNew() ? 'The schedule has added' : 'The schedule has updated');
$results = explode('-', $schedule->start_date);
$this->redirect(sprintf('@calendar_year_month?year=%d&month=%d', $results[0], $results[1]));
}
}
示例2: executeDeletePair
public function executeDeletePair(sfWebRequest $request)
{
$pair = MappingPairTable::getInstance()->find($request->getParameter('id'));
if (!$pair) {
return $this->notFound();
}
/* @var $pair MappingPair */
$form = new BaseForm();
$form->getWidgetSchema()->setNameFormat('delete_pair[%s]');
$form->bind($request->getPostParameter($form->getName()));
if ($form->isValid()) {
$id = $pair->getId();
$pair->delete();
return $this->ajax()->remove('#pair_' . $id)->remove('#pair_form_' . $id)->render();
} else {
return $this->ajax()->form($form)->render();
}
}
示例3: processForm
private function processForm(BaseForm $form, sfWebRequest $request, $type = null)
{
$name = $form->getName();
$form->bind($request->getParameter($name), $request->getFiles($name));
if ($this->setFlashMessageByType($form->isValid(), $type)) {
$form->save();
}
$this->redirect('@opCalendarPlugin');
}