Esempio n. 1
0
 protected function createComponentColor()
 {
     $form = new Nette\Application\UI\Form();
     $form->addProtection();
     foreach ($this->tags->findBy([]) as $tag) {
         $form->addText('color' . $tag->id)->setType('color')->setValue('#' . $tag->color);
         $form->addSubmit('update' . $tag->id, 'Změnit barvu')->onClick[] = function ($this) use($tag) {
             $this->colorSucceeded($this, $tag->id);
         };
     }
     return $form;
 }