hidden() public method

Create a hidden input field.
public hidden ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
return Illuminate\Support\HtmlString
コード例 #1
0
 public function checkbox($name, $value = 1, $checked = null, $options = [])
 {
     $options['id'] = $name;
     return sprintf('
     <div class="input-field col l6 s8 offset-l3 offset-s2">
         %s
         %s
         %s
     </div>', parent::hidden($name, 0), parent::checkbox($name, $value, $checked, $options), parent::label($name, null, []));
 }
コード例 #2
0
 /**
  * Create a hidden input field.
  *
  * @param string $name
  * @param string $value
  * @param array $options
  * @return string 
  * @static 
  */
 public static function hidden($name, $value = null, $options = array())
 {
     return \Collective\Html\FormBuilder::hidden($name, $value, $options);
 }
コード例 #3
0
 public function checkbox($name, $value = 1, $checked = null, $options = [])
 {
     return parent::hidden($name, 0) . call_user_func_array('parent::' . __FUNCTION__, func_get_args());
 }
コード例 #4
0
 /**
  * Create a hidden field.
  *
  * @param  string $name
  * @param  string $value
  * @param  array  $options
  *
  * @return string
  */
 public function hidden($name, $value = null, $options = [])
 {
     return $this->form->hidden($name, $value, $options);
 }
コード例 #5
0
ファイル: macros.php プロジェクト: brunoti/html-macros
    return field_wrapper($name, $label, $element);
});
Form::macro('passwordFieldClean', function ($name, $label = NULL, $value = NULL, $attributes = []) {
    $attributes = array_merge($attributes, ['placeholder' => $label]);
    $element = Form::password($name, field_attributes($name, $attributes));
    return form_group($element, $name);
});
Form::macro('textareaField', function ($name, $label = NULL, $value = NULL, $attributes = []) {
    $attributes = array_merge($attributes, ['rows' => 4]);
    $element = Form::textarea($name, $value ? $value : old($name), field_attributes($name, $attributes));
    return field_wrapper($name, $label, $element);
});
Form::macro('tinymce', function ($name, $label = NULL, $value = NULL, $attributes = []) {
    $attributes = array_merge($attributes, ['rows' => 4, 'data-tinymce' => 'true']);
    $element = Form::textarea($name, $value ? $value : old($name), field_attributes($name, $attributes));
    $element .= Form::hidden($name . '_text', $value ? $value : old($name), ['id' => $name . '_text']);
    return field_wrapper($name, $label, $element);
});
Form::macro('fileField', function ($name, $label = NULL, $attributes = []) {
    $element = '<p>' . Form::file($name, field_attributes($name, $attributes, true)) . '</p>';
    return field_wrapper($name, $label, $element);
});
Form::macro('textareaFieldClean', function ($name, $label = NULL, $value = NULL, $attributes = []) {
    $attributes = array_merge($attributes, ['placeholder' => $label, 'rows' => 4]);
    $element = Form::textarea($name, $value ? $value : old($name), field_attributes($name, $attributes));
    return form_group($element, $name);
});
Form::macro('selectFieldClean', function ($name, $label = NULL, $options, $value = NULL, $attributes = []) {
    $attributes = array_merge($attributes, ['placeholder' => $label]);
    $element = Form::select($name, $options, $value ? $value : old($name), field_attributes($name, $attributes));
    return form_group($element, $name);