Ejemplo n.º 1
0
 /**
  * @return string
  */
 public function render()
 {
     $content = [];
     $content[] = $this->formBuilder->model($this->instance, ['method' => $this->method, 'url' => $this->saveUrl, 'errors' => $this->errors]);
     foreach ($this->items as $item) {
         $content[] = $item->render();
     }
     $content[] = $this->formBuilder->submitGroup($this->backUrl);
     $content[] = $this->formBuilder->close();
     return implode('', $content);
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 public function renderInline()
 {
     $content = [];
     $id = uniqid();
     $content[] = $this->formBuilder->model($this->instance, ['method' => $this->method, 'url' => $this->saveUrl, 'errors' => $this->errors, 'class' => 'form-horizontal form-bordered', 'id' => $id, 'onsubmit' => 'return inlineFormSubmit(event, \'' . $id . '\');']);
     foreach ($this->inlineItems as $item) {
         if (method_exists($item, 'inlineEdit')) {
             $item->inlineEdit(true);
         }
         $content[] = $item->render();
     }
     if (count($this->inlineItems) == 1) {
         if ($this->inlineItems[0] instanceof Checkbox) {
         } else {
             $content[] = view('admin::model/inline_edit_form_controls')->with('inline_controls', true);
         }
     } else {
         $content[] = view('admin::model/inline_edit_form_controls')->with('inline_controls', false);
     }
     $content[] = $this->formBuilder->close();
     $response = implode('', $content);
     return $response;
 }