Пример #1
0
 protected function createComponentClanek()
 {
     $form = new Form();
     $form->addHidden("id");
     $form->addText("titulek", "Titulek")->addRule(Form::MAX_LENGTH, "Titulek je příliš dlouhý", 64);
     $form->addText("autor", "Autor")->addRule(Form::MAX_LENGTH, "Autor je příliš dlouhý", 64);
     $form->addSelect("kategorie_id", "Kategorie", $this->kategorie->getPairs());
     $form->addTextArea("perex", "Perex");
     $form->addSelect("obrazek_id", "Obrázek", $this->upload->getPairs())->setPrompt("-- bez obrázku --");
     $form->addTextArea("text", "Text");
     $form->addTextArea("stitky_text", "Štítky");
     $form->addText("skupina", "Skupina");
     $form->addSubmit("save", "Uložit");
     $form->onSuccess[] = $this->saveClanek;
     return $form;
 }