Witam
mam taki problem. Robię panel administracyjny Backend do jednej strony i zrobiłem prosty system aktualności ale mam problem żeby w formularzu który wygląda tak :
abstract class BaseAktualnosciForm extends BaseFormPropel
{
public function setup()
{
'id' => new sfWidgetFormInputHidden(),
'autor_id' => new sfWidgetFormPropelChoice
(array('model' => 'Pracownik', 'add_empty' => false)), 'tytul' => new sfWidgetFormInputText(),
'slug' => new sfWidgetFormInputText(),
'skrot' => new sfWidgetFormInputText(),
'tresc' => new sfWidgetFormTextarea(),
'created_at' => new sfWidgetFormDateTime(),
'updated_at' => new sfWidgetFormDateTime(),
));
$this->setValidators(array( 'id' => new sfValidatorPropelChoice
(array('model' => 'Aktualnosci', 'column' => 'id', 'required' => false)), 'autor_id' => new sfValidatorPropelChoice
(array('model' => 'Pracownik', 'column' => 'id')), 'tytul' => new sfValidatorString
(array('max_length' => 255, 'required' => false)), 'slug' => new sfValidatorString
(array('max_length' => 255, 'required' => false)), 'skrot' => new sfValidatorString
(array('max_length' => 255, 'required' => false)), 'tresc' => new sfValidatorString
(array('required' => false)), 'created_at' => new sfValidatorDateTime
(array('required' => false)), 'updated_at' => new sfValidatorDateTime
(array('required' => false)), ));
$this->widgetSchema->setNameFormat('aktualnosci[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
parent::setup();
}
próbuje go stroszke dostroić
class AktualnosciForm extends BaseAktualnosciForm
{
public function configure()
{
unset($this['created_at'],$this['updated_at'],$this['slug']); $this->widgetSchema['skrot'] = new sfWidgetFormBBCodeEditor();
$this->widgetSchema['tresc'] = new sfWidgetFormBBCodeEditor();
}
}
i mam problem jak nastawić by pole autor_id przybierało id zalogowanego administratora jednym słowem jak w pliku AktualnosciForm dobrać się do sfUser, by ustawić setDefault('autor_id',


)
Pomóżcie !