当前位置: 首页>>代码示例>>PHP>>正文


PHP FormBuilder::open方法代码示例

本文整理汇总了PHP中Collective\Html\FormBuilder::open方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::open方法的具体用法?PHP FormBuilder::open怎么用?PHP FormBuilder::open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Collective\Html\FormBuilder的用法示例。


在下文中一共展示了FormBuilder::open方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: open

 /**
  * Return the opening form tag.
  *
  * @param array $options
  * @return string
  */
 public function open(array $options = [])
 {
     if ($url = $this->object->getOption('url')) {
         $options['url'] = $url;
     }
     return $this->html->open($options);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:13,代码来源:FormPresenter.php

示例2: open

 /**
  * Open a form while passing a model and the routes for storing or updating
  * the model. This will set the correct route along with the correct
  * method.
  *
  * @param  array $options
  *
  * @return string
  */
 public function open(array $options = [])
 {
     // Set the HTML5 role.
     $options['role'] = 'form';
     // Set the class for the form type.
     if (!array_key_exists('class', $options)) {
         $options['class'] = $this->getType();
     }
     if (array_key_exists('left_column_class', $options)) {
         $this->setLeftColumnClass($options['left_column_class']);
     }
     if (array_key_exists('left_column_offset_class', $options)) {
         $this->setLeftColumnOffsetClass($options['left_column_offset_class']);
     }
     if (array_key_exists('right_column_class', $options)) {
         $this->setRightColumnClass($options['right_column_class']);
     }
     if (array_key_exists('label_required_mark', $options)) {
         $this->setLabelRequiredMark($options['label_required_mark']);
     }
     if (array_key_exists('group_required_class', $options)) {
         $this->setLabelRequiredMark($options['group_required_class']);
     }
     array_forget($options, ['left_column_class', 'left_column_offset_class', 'right_column_class', 'label_required_mark', 'group_required_class']);
     if (array_key_exists('model', $options)) {
         return $this->model($options);
     }
     return $this->form->open($options);
 }
开发者ID:bnbwebexpertise,项目名称:laravel-bootstrap-form,代码行数:38,代码来源:BootstrapForm.php

示例3: open

 /**
  * Open up a new HTML form. 
  * Sets "form-horizontal" as the default class for forms.
  *
  * @param  array   $options
  * @return string
  */
 public function open(array $options = array())
 {
     if (!isset($options['class'])) {
         $options['class'] = 'form-horizontal';
     }
     return parent::open($options);
 }
开发者ID:exelv1,项目名称:Contentify,代码行数:14,代码来源:FormBuilder.php

示例4: open

 /**
  * Open up a new HTML form and pass the optional novalidate option.
  * This methods relies on the original Form::open method of the Laravel
  * Collective component.
  *
  * @param array $options
  *
  * @return string
  */
 public function open(array $options = array())
 {
     if ($this->novalidate()) {
         $options[] = 'novalidate';
     }
     return parent::open($options);
 }
开发者ID:mcarral,项目名称:html,代码行数:16,代码来源:FormBuilder.php

示例5: open

 /**
  * Open a form while passing a model and the routes for storing or updating
  * the model. This will set the correct route along with the correct
  * method.
  *
  * @param  array  $options
  * @return string
  */
 public function open(array $options = [])
 {
     // Set the HTML5 role.
     $options['role'] = 'form';
     // Set the class for the form type.
     if (!array_key_exists('class', $options)) {
         $options['class'] = $this->getType();
     }
     if (array_key_exists('left_column_class', $options)) {
         $this->setLeftColumnClass($options['left_column_class']);
     }
     if (array_key_exists('left_column_offset_class', $options)) {
         $this->setLeftColumnOffsetClass($options['left_column_offset_class']);
     }
     if (array_key_exists('right_column_class', $options)) {
         $this->setRightColumnClass($options['right_column_class']);
     }
     // Set the name of the error bag to pull from the session.  The default is "default".
     // This allows multiple forms to be on the same page without error messages colliding
     if (array_key_exists('errorBag', $options)) {
         $this->errorBag = $options['errorBag'];
     }
     array_forget($options, ['left_column_class', 'left_column_offset_class', 'right_column_class', 'errorBag']);
     if (array_key_exists('model', $options)) {
         return $this->model($options);
     }
     return $this->form->open($options);
 }
开发者ID:mstralka,项目名称:bootstrap-form,代码行数:36,代码来源:BootstrapForm.php

示例6: open

 public function open(array $options = [])
 {
     if (array_key_exists('model', $options)) {
         PkForm::setModel($options['model']);
         unset($options['model']);
     }
     return parent::open($options);
 }
开发者ID:pkirkaas,项目名称:PkExtensions,代码行数:8,代码来源:PkFormBuilder.php

示例7: open

 /**
  * @param array $options
  *
  * @return string
  */
 public function open(array $options = [])
 {
     $themeName = array_get($options, 'theme', config('rutorika-form.theme'));
     $themeClass = config('rutorika-form.themes.' . $themeName);
     $this->theme = new $themeClass($this);
     $options = $this->theme->updateOptions($options);
     return parent::open($options);
 }
开发者ID:grozwalker,项目名称:rutorika-laravel-html,代码行数:13,代码来源:FormBuilder.php

示例8: open

 /**
  * Opens form with a set of validation rules
  * @param array $rules Laravel validation rules
  * @see Collective\Html\FormBuilder
  * @return string
  */
 public function open(array $options = [], $rules = null)
 {
     $this->setValidation($rules);
     if (isset($options['name'])) {
         $this->converter->setFormName($options['name']);
     } else {
         $this->converter->setFormName(null);
     }
     return parent::open($options);
 }
开发者ID:laravel-ardent,项目名称:laravalid,代码行数:16,代码来源:FormBuilder.php

示例9: open

 /**
  * Open a form while passing a model and the routes for storing or updating
  * the model. This will set the correct route along with the correct
  * method.
  *
  * @param  array  $options
  * @return string
  */
 public function open(array $options = [])
 {
     // Set the HTML5 role.
     $options['role'] = 'form';
     // Set the class for the form type.
     if (!isset($options['class'])) {
         $options['class'] = $this->getType();
     }
     if (isset($options['left_column_class'])) {
         $this->setLeftColumnClass($options['left_column_class']);
     }
     if (isset($options['left_column_offset_class'])) {
         $this->setLeftColumnOffsetClass($options['left_column_offset_class']);
     }
     if (isset($options['right_column_class'])) {
         $this->setRightColumnClass($options['right_column_class']);
     }
     array_forget($options, ['left_column_class', 'left_column_offset_class', 'right_column_class']);
     if (isset($options['model'])) {
         return $this->model($options);
     }
     return $this->form->open($options);
 }
开发者ID:jeylabs,项目名称:larastrap,代码行数:31,代码来源:BootstrapForm.php

示例10: open

 /**
  * Open up a new HTML form.
  *
  * @param array $options
  * @return string 
  * @static 
  */
 public static function open($options = array())
 {
     return \Collective\Html\FormBuilder::open($options);
 }
开发者ID:alvarobfdev,项目名称:BaseCRUDproject,代码行数:11,代码来源:_ide_helper.php

示例11: open

 public function open(array $options = [])
 {
     $this->initializeForm($options);
     return parent::open($options);
 }
开发者ID:genealabs,项目名称:laravel-casts,代码行数:5,代码来源:FormBuilder.php

示例12: function

Form::macro('delete', function ($route, $id, $text = '', $tooltip = false, $icon = true) {
    $model = explode('.', $route);
    $model = ucfirst(substr($model[1], 0, -1));
    $tooltip = $tooltip ? $tooltip : 'Deletar ' . $model;
    $out = Form::open(['route' => [$route . '.destroy', $id], 'method' => 'DELETE', 'data-id' => $id, 'style' => 'display: inline-block']);
    $out .= '<button data-toggle="tooltip" data-placement="top" data-original-title="' . $tooltip . '" type="submit" data-id="' . $id . '" class="btn btn-danger btn-sm ' . ($icon ? 'btn-fw' : '') . '">';
    $out .= $icon ? '<i class="fa fa-times"></i> &nbsp;' . $text : $text;
    $out .= '</button>';
    $out .= Form::close();
    return $out;
});
Form::macro('undelete', function ($route, $id, $text = '', $tooltip = false) {
    $model = explode('.', $route);
    $model = ucfirst(substr($model[1], 0, -1));
    $tooltip = $tooltip ? $tooltip : 'Reativar ' . $model;
    $out = Form::open(['route' => [$route . '.undestroy', $id], 'method' => 'PUT', 'data-confirm' => $id . '-ativar', 'style' => 'display: inline-block']);
    $out .= '<button data-toggle="tooltip" data-placement="top"
        data-original-title="' . $tooltip . '" type="submit" data-confirm="' . $id . '-ativar" class="btn btn-warning btn-fw btn-sm">';
    $out .= '<i class="fa fa-undo"></i> &nbsp;' . $text;
    $out .= '</button>';
    $out .= Form::close();
    return $out;
});
Form::macro('edit', function ($route, $id, $text = '', $tooltip = false) {
    $model = explode('.', $route);
    $model = ucfirst(substr($model[1], 0, -1));
    $tooltip = $tooltip ? $tooltip : 'Editar ' . $model;
    $out = '<a data-toggle="tooltip" data-placement="top" data-original-title="' . $tooltip . '" href="' . route($route . '.edit', $id) . '" class="btn btn-fw btn-success btn-sm">';
    $out .= '<i class="fa fa-pencil"></i> &nbsp;' . $text;
    $out .= '</a>';
    return $out;
开发者ID:brunoti,项目名称:html-macros,代码行数:31,代码来源:macros.php


注:本文中的Collective\Html\FormBuilder::open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。