コード例 #1
0
ファイル: Form.php プロジェクト: zgao4/laravel-form-builder
    /**
     * Render the form
     *
     * @param $options
     * @param $fields
     * @param boolean $showStart
     * @param boolean $showFields
     * @param boolean $showEnd
     * @return string
     */
    protected function render($options, $fields, $showStart, $showFields, $showEnd)
    {
        $formOptions = $this->formHelper->mergeOptions($this->formOptions, $options);

        $this->setupNamedModel();

        return $this->formHelper->getView()
            ->make($this->formHelper->getConfig('form'))
            ->with(compact('showStart', 'showFields', 'showEnd'))
            ->with('formOptions', $formOptions)
            ->with('fields', $fields)
            ->with('model', $this->getModel())
            ->with('exclude', $this->exclude)
            ->render();
    }
コード例 #2
0
 /**
  * Merge all defaults with field specific defaults and set template if passed
  *
  * @param array $options
  */
 protected function setDefaultOptions(array $options = [])
 {
     $this->options = $this->formHelper->mergeOptions($this->allDefaults(), $this->getDefaults());
     $this->options = $this->prepareOptions($options);
 }