public function configure() { $user_id = sfContext::getInstance()->getUser()->getGuardUser()->id; $query = Doctrine_Query::create() ->from('UserFamily t') ->where('t.user_id=?', $user_id); $this->widgetSchema['user_family_id'] = new sfWidgetFormDoctrineChoice(array( 'model' => $this->getRelatedModelName('UserFamily'), 'add_empty' => false, 'query' => $query, 'method' => 'getFullName', )); $this->widgetSchema['procedure_id'] = new sfWidgetFormInputHidden(array(), array( 'value'=>$this->getObject()->get('procedure_id') )); } public function getFullName() { $civilite = UserFamily::getCiviliteList(); return $civilite[$this['civilite']].' '.$this['prenom'].' '.$this['nom']; }
Friday, February 18, 2011
Creating Options
Sample code:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment