當前位置: 首頁>>代碼示例>>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: 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

示例6: populate

 public function populate($form, array $options = array())
 {
     return $this->form->model($form->getData(), $options);
 }
開發者ID:Junyue,項目名稱:zidisha2,代碼行數:4,代碼來源:BootstrapFormBuilder.php


注:本文中的Illuminate\Html\FormBuilder::model方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。