HosipLan

Untitled

Mar 22nd, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. protected function createComponentForm($name)
  2. {
  3.     $this[$name] = $form = new Nette\Application\UI\Form;
  4.  
  5.     $pairs = array('a', 'b', 'c'); // třeba z databáze
  6.     $form->addSelect('one', 'One', $pairs);
  7.  
  8.     $pairsTwo = $this->model->findBy($form['one']->value); // vytahne zavisle
  9.     // $pairsTwo = array('d', 'e', 'f');
  10.     $form->addSelect('two', 'Two', $pairsTwo);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment