Php 拉维形式问题

Php 拉维形式问题,php,twitter-bootstrap,laravel,Php,Twitter Bootstrap,Laravel,在laravel中使用Form类的两个问题。发现很难习惯使用数组传递参数我正在使用twitter引导: 将类添加到选择类型不起作用 使用单选按钮正确输出 一, 二, {{Form::label('gender','gender',array('class'=>'controllabel'))} {{Form::radio('gender','Male')}}Male {{Form::radio('gender','Female')}}Female 请输入您的性别 1)您传递了错误的值 publ

在laravel中使用Form类的两个问题。发现很难习惯使用数组传递参数我正在使用twitter引导:

  • 将类添加到选择类型不起作用
  • 使用单选按钮正确输出
  • 一,

    二,

    
    {{Form::label('gender','gender',array('class'=>'controllabel'))}
    {{Form::radio('gender','Male')}}Male
    {{Form::radio('gender','Female')}}Female
    

    请输入您的性别

    1)您传递了错误的值

    public static function select($name, $options = array(), $selected = null, $attributes = array())
    
    您必须传递所选值、会话或
    Input::old('name')


    2) 在我的模板上看起来不错,我有相同的代码。您能发布更多信息吗?

    当您的示例向函数传递NULL时,您的评论“您必须传递所选的值、会话或输入::old('name')”让我有点困惑。NULL是否只是指使用它将自动计算的任何值?我的直觉是“是的”,但我很好奇。@MichaelCordingley如果你回顾函数签名和源代码,它可能会比我在这里回答你的问题更好。第三个参数是当前选择的值,可以来自会话或
    输入::old('name')
    。我可以看出我的答案并不清楚,但是代码片段比我拙劣的解释更清楚:)
    <div class="control-group">
    <div class="controls">
      {{ Form::label('gender', 'Gender', array('class' => 'control-label')) }}
      <label class="radio">
      {{ Form::radio('gender', 'Male') }} Male
      </label>
    
      <label class="radio">
      {{ Form::radio('gender', 'Female') }} Female
      </label>
     <p class="help-block"> Please enter your gender</p>
    </div>
    </div>
    
    public static function select($name, $options = array(), $selected = null, $attributes = array())
    
    {{ Form::select('title', array('Mr', 'Mrs', 'Ms', 'Miss', 'Master', 'Dr', 'Prof'), $selected = NULL,  array('class' => 'input-small')) }}