Exemplo n.º 1
0
 /**
  * @param Element $element
  * @return Form
  */
 public function add(Element $element)
 {
     if ($element instanceof File) {
         $this->enableFileUploads();
     }
     $this->elements[$element->name()] = $element;
     return $this;
 }
Exemplo n.º 2
0
 /**
  * @param ElementView $view
  * @return ElementView
  */
 public function buildView(ElementView $view = null)
 {
     $view = new ElementView();
     $view = parent::buildView($view);
     $view->block = 'input';
     return $view;
 }
Exemplo n.º 3
0
 /**
  * @param ElementView $view
  * @return ElementView
  */
 public function buildView(ElementView $view = null)
 {
     $view = new ElementView();
     /** @var ElementView $view */
     $view = parent::buildView($view);
     $view->block = 'textarea';
     return $view;
 }
Exemplo n.º 4
0
 /**
  * @param ElementView $view
  * @return CaptchaView
  */
 public function buildView(ElementView $view = null)
 {
     $view = new ElementView();
     /** @var ElementView $view */
     $view = parent::buildView($view);
     $view->options = array_merge(['captcha_id' => $this->captchaAdapter->generate()], $this->captchaAdapter->options());
     $view->value = $view->options['captcha_id'];
     $view->block = "captcha_{$this->captchaAdapter->name()}";
     return $view;
 }
Exemplo n.º 5
0
 /**
  * @param ElementView $view
  * @return ElementView
  */
 public function buildView(ElementView $view = null)
 {
     if (!$view) {
         $view = new ElementView();
     }
     /** @var ElementView $view */
     $view = parent::buildView($view);
     $view->choices = $this->choices;
     return $view;
 }
Exemplo n.º 6
0
 /**
  * @param ElementView $view
  * @return MoneyView
  */
 public function buildView(ElementView $view = null)
 {
     $view = new MoneyView();
     /** @var MoneyView $view */
     $view = parent::buildView($view);
     $view->amount = $this->amount->buildView();
     $view->currency = $this->currency;
     $view->block = 'money';
     return $view;
 }