public function execute($sfRequest) { if ($id = $sfRequest->getUrlParameter('registration_id')) { $this->getRegistration($sfRequest, 'registration_id'); if ($id = $sfRequest->getUrlParameter('id')) { $this->getContext()->getRouting()->setDefaultParameter('id', $id); } } else { $this->getRegistration($sfRequest); } // $this->checkProcess($sfRequest); // used in dsRegistration // $this->getUser()->setFlash('process', $this->process); $result = parent::execute($sfRequest); // UPDATE: This is required for the 'new' action if (isset($this->form) && $this->form->getObject() && $this->form->getObject()->isNew()) { // $this->form->getObject()-> = $this->course->getID(); } return $result; }
public function execute($request) { $this->forward404Unless(opConfig::get('enable_jsonapi')); $moduleName = strtolower($this->moduleName); sfConfig::set('mod_' . $moduleName . '_view_class', 'opJsonApi'); $this->getResponse()->setContentType('application/json'); $enableEscaping = true; if (isset($request['escaping'])) { $enableEscaping = in_array($request['escaping'], array('1', 'on', 'true')); } sfConfig::set('sf_escaping_strategy', $enableEscaping); return parent::execute($request); }
public function execute($request) { // Ensure format is set correctly $params = $this->getRoute()->getParameters(); $request->setRequestFormat(isset($params['sf_format']) ? $params['sf_format'] : 'xml'); // Add layout for xml if ($request->getRequestFormat() == 'xml') { $this->setLayout('layout'); } // Add callback for jsonp if ($request->getRequestFormat() == 'json') { $this->callback = $request->getParameter('callback'); } $this->getResponse()->setStatusCode(200); return parent::execute($request); }
public function execute($sfRequest) { /* $this->forward404Unless( $this->registration_id = $sfRequest->getUrlParameter('registration_id')); $this->forward404Unless( $this->registration = Doctrine::getTable('smRegistration')->findOneById($this->registration_id)); $this->getContext()->getRouting() ->setDefaultParameter('registration_id', $this->registration_id); */ if ($id = $sfRequest->getUrlParameter('id')) { $this->getContext()->getRouting()->setDefaultParameter('id', $id); } $result = parent::execute($sfRequest); // UPDATE: This is required for the 'new' action /* if (isset($this->form) && $this->form->getObject() && $this->form->getObject()->isNew()) { // $this->form->getObject()-> = $this->course->getID(); } */ return $result; }
public function execute($sfRequest) { $this->forward404Unless( $this->class_id = $sfRequest->getUrlParameter('class_id')); $this->forward404Unless( $this->class = Doctrine::getTable('dsClass')->findOneById($this->class_id)); $this->getContext()->getRouting() ->setDefaultParameter('class_id', $this->class_id); $this->getContext()->getRouting() ->setDefaultParameter('dance_slug', $this->class->getDance()->getSlug() ); $result = parent::execute($sfRequest); return $result; }