當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。