예제 #1
0
 public function getComponent($name, $need = TRUE)
 {
     $component = $this->component->getComponent($name, $need);
     if ($component !== NULL) {
         $component = $this->wrapComponent($name, $component);
     }
     return $component;
 }
예제 #2
0
	/**
	 * Helper for {form ...} macro.
	 *
	 * @param    Nette\Forms\Form|string form instance or form name in given control
	 * @param    Nette\Application\UI\PresenterComponent
	 * @param    array             list of modifiers (name => value)
	 * @return   Nette\Forms\Form
	 */
	public static function beginForm($form, Nette\Application\UI\PresenterComponent $control, array $modifiers = NULL)
	{
		$form = ($form instanceof Nette\Forms\Form ? $form : $control->getComponent($form));
		self::$containerStack = array($form);

		if ($modifiers) self::addAttributes($form->getElementPrototype(), $modifiers, array('class', 'style'));
		$form->render('begin');

		return $form;
	}