-
-
Save garak/549660 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* healthstate actions. | |
* | |
* @package ordinativi | |
* @subpackage healthstate | |
* @author KEY5 | |
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ | |
*/ | |
class healthstateActions extends sfActions | |
{ | |
// ... | |
public function executeCreate(sfWebRequest $request) | |
{ | |
$this->forward404Unless($request->isMethod(sfRequest::POST)); | |
$user = $this->getUser()->getGuardUser(); | |
$this->form = new OrdinativiHealthStateForm(new OrdinativiHealthState(), array('user_id'=>$user->getId())); | |
$this->processForm($request, $this->form); | |
$this->setTemplate('new'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* OrdinativiHealthState form. | |
* | |
* @package ordinativi | |
* @subpackage form | |
* @author Your name here | |
* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ | |
*/ | |
class OrdinativiHealthStateForm extends BaseOrdinativiHealthStateForm | |
{ | |
public function configure() | |
{ | |
$this->useFields(array('name')); | |
$this->widgetSchema->setLabels(array( | |
'name' => 'Nome', | |
)); | |
$this->getObject()->setUserId($this->getOption('user_id')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$this->forward404Unless($request->isMethod(sfRequest::POST)); è superata. Metti piuttosto un requirement nel routing