/** * Обработка формы * * @param EventForm $form * @param sfWebRequest $request */ protected function processForm(EventForm $form, sfWebRequest $request) { $form->bind($request->getParameter($form->getName())); if ($form->isValid()) { $event = $form->save(); if ($request->isXmlHttpRequest()) { $event = EventTable::getInstance()->queryWithCount(null, 'e')->where('e.id = ?', $event->id)->fetchOne(); return $this->renderPartial('event/show', array('event' => $event)); } else { return $this->redirect('event_show', $event); } } return sfView::SUCCESS; }