no nie działa ;/ podam może przykładowy kod
<?php
class InformacjeForm extends BaseForm
{
protected
static $subjects = array('Subject A', 'Subject B', 'Subject C');
public function configure()
{
'tytul' => new sfWidgetFormInputText(),
'dzial' => new sfWidgetFormSelect
(array('choices' => self::$subjects)), 'tresc' => new sfWidgetFormTextarea(),
'data' => new sfWidgetFormInputHidden(),
));
$this->widgetSchema->setNameFormat('informacje[%s]');
$this->setValidators(array( 'tytul' => new sfValidatorString(),
'dzial' => new sfValidatorChoice
(array('choices' => array_keys(self::$subjects))), 'tresc' => new sfValidatorString
(array('min_length' => 4
), array('required' => 'The message field is required.')), ));
}
}
a teraz akcja
$top = 'sccc';
$this->form = new LoginForm();
$this->form->setDefault('data', $top );