本文整理汇总了PHP中Illuminate\Html\FormBuilder::open方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::open方法的具体用法?PHP FormBuilder::open怎么用?PHP FormBuilder::open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Html\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: open
/**
* @param array $options
* @return string
*/
public function open(array $options = [])
{
$this->errors = array_get($options, 'errors');
array_forget($options, 'errors');
array_set($options, 'files', true);
return parent::open($options);
}
示例3: 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 = array())
{
$options = $this->parseModelBinding($options);
// Set the HTML5 role.
$options['role'] = 'form';
// If the class hasn't been set, set the default style.
if (!isset($options['class'])) {
$defaultForm = $this->getDefaultForm();
if ($defaultForm === 'horizontal') {
$options['class'] = 'form-horizontal';
} else {
if ($defaultForm === 'inline') {
$options['class'] = 'form-inline';
}
}
}
return $this->form->open($options);
}
示例4: open
public function open(array $options = array())
{
if (!array_key_exists('autocomplete', $options)) {
$options['autocomplete'] = 'off';
}
if (empty($options['role'])) {
$options['role'] = 'form';
}
return parent::open($options);
}
示例5: open
/**
* Opens form, set rules
*
* @param array $rules Laravel validation rules
*
* @see Illuminate\Html\FormBuilder
*/
public function open(array $options = array(), $rules = null)
{
$this->setValidation($rules);
if (isset($options['name'])) {
$this->converter->setFormName($options['name']);
} else {
$this->converter->setFormName(null);
}
return parent::open($options);
}
示例6: open
/**
* Open up a new HTML form.
* Form model uses this so we dont have to check again
*
* @param array $options
* @return string
*/
public function open(array $options = array())
{
// Check if the user has access if not dont show the element
if (!$this->checkRoleAccess($options)) {
$this->access = false;
return;
} else {
$this->access = true;
}
return parent::open($options);
}
示例7: open
/**
* Open up a new HTML form and includes a session key.
* @param array $options
* @return string
*/
public function open(array $options = [])
{
$method = strtoupper(array_get($options, 'method', 'post'));
$request = array_get($options, 'request');
$model = array_get($options, 'model');
if ($model) {
$this->model = $model;
}
$append = $this->requestHandler($request);
if ($method != 'GET') {
$append .= $this->sessionKey(array_get($options, 'sessionKey'));
}
return parent::open($options) . $append;
}
示例8: 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);
}
}
示例9: open
/**
* Open up a new HTML form.
*
* @param array $options
* @return string
*/
public function open(array $options = array())
{
if (isset($options['errors'])) {
if (is_array($options['errors'])) {
$this->setErrors($options['errors'][0]);
if (isset($options['errors'][1])) {
$this->errorCssClass = $options['errors'][1];
}
} else {
$this->setErrors($options['errors']);
}
unset($options['errors']);
}
return parent::open($options);
}
示例10: open
/**
* Overrides the base form open method to allow for automatic insertion of csrf tokens
* and form class
*
* @param array $attributes
* @return string
*/
public function open(array $attributes = array())
{
// Add in the form class if necessary
if (empty($attributes['class'])) {
$attributes['class'] = $this->getOption('formClass');
} elseif (strpos($attributes['class'], 'form-') === false) {
$attributes['class'] .= ' ' . $this->getOption('formClass');
}
return parent::open($attributes);
}
示例11: busqueda
public function busqueda($params)
{
$this->buscando = true;
return parent::open($params);
}
示例12: open
public function open(array $options = array())
{
$default = ['files' => true];
$options = array_merge($default, $options);
return parent::open($options);
}
示例13: 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 = [])
{
$this->translationDomain = array_get($options, 'translationDomain', '');
unset($options['translationDomain']);
return $this->form->open($options);
}
示例14: open
/**
* Open up a new HTML form.
*
* @param array $options
* @return \Illuminate\Support\HtmlString
*/
public function open(array $options = [])
{
return new HtmlString(parent::open($options));
}
示例15: open
/**
* Opens form, set rules
*
* @param array $rules Laravel validation rules
*
* @see Illuminate\Html\FormBuilder
*/
public function open(array $options = array(), $rules = null)
{
$this->setValidation($rules);
return parent::open($options);
}