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


PHP FormBuilder::model方法代码示例

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


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

示例1: formOpen

 /**
  * @param Form $form
  * @return mixed
  */
 public function formOpen(Form $form)
 {
     $options = $form->getAttributes();
     $options['files'] = $form->files;
     if ($action = $form->action) {
         $options[$form->actionType] = $action;
     }
     if ($model = $form->model) {
         $html = $this->builder->model($model, $options);
         $form->fill(array_dot($model->toArray()));
     } else {
         $html = $this->builder->open($options);
     }
     return $html;
 }
开发者ID:iyoworks,项目名称:form-builder,代码行数:19,代码来源:LaravelFormRenderer.php

示例2: open

 /**
  * Open the form, and add the fields for an specific action or the default fields if no action is defined.
  *
  * @param  string|null $action
  * @param  array       $attributes
  *
  * @return string
  */
 public function open($action = null, array $attributes = array())
 {
     if (is_array($action)) {
         $attributes = $action;
         $action = null;
     }
     $form = $this->formFor($action);
     $attributes = array_merge($attributes, ['method' => $this->method, 'url' => $this->action, 'files' => $this->hasFile()]);
     if ($this->model) {
         return $this->builder->model($this->model, $attributes);
     } else {
         return $this->builder->open($attributes);
     }
 }
开发者ID:ruysu,项目名称:laravel4-form,代码行数:22,代码来源:FormBuilder.php

示例3: parseModelBinding

 /**
  * Parse the model binding and set the appropriate keys for
  * routing.
  *
  * @param  array  $options
  * @return array
  */
 protected function parseModelBinding($options)
 {
     // If the form is passed a model, we'll use the update route to update
     // the model using the PUT method.
     if (isset($options['model']) && $options['model']->getKey()) {
         $options['route'] = array($options['update'], $options['model']->getKey());
         $options['method'] = 'put';
     } else {
         if (isset($options['store'])) {
             $options['route'] = $options['store'];
             $options['method'] = 'post';
         }
     }
     //bind the model to the form and remove it from the options
     $this->form->model($options['model']);
     array_forget($options, 'model');
     // Forget the routes provided to the input.
     array_forget($options, 'update');
     array_forget($options, 'store');
     return $options;
 }
开发者ID:Javier-Rotelli,项目名称:bootstrap-form,代码行数:28,代码来源:BootstrapForm.php

示例4: model

 /**
  * Create a new model based form builder.
  *
  * @param mixed $model
  * @param array $options
  * @return string 
  * @static 
  */
 public static function model($model, $options = array())
 {
     return \Illuminate\Html\FormBuilder::model($model, $options);
 }
开发者ID:nmkr,项目名称:basic-starter,代码行数:12,代码来源:_ide_helper.php

示例5: populate

 public function populate($form, array $options = array())
 {
     return $this->form->model($form->getData(), $options);
 }
开发者ID:Junyue,项目名称:zidisha2,代码行数:4,代码来源:BootstrapFormBuilder.php

示例6: model

 /**
  * Create a new model based form builder.
  *
  * @param array $rules 		Laravel validation rules
  *
  * @see Illuminate\Html\FormBuilder
  */
 public function model($model, array $options = array(), $rules = null)
 {
     $this->setValidation($rules);
     return parent::model($model, $options);
 }
开发者ID:bllim,项目名称:laravel-to-jquery-validation,代码行数:12,代码来源:FormBuilder.php


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