Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Form::select
  • I use in my program

    <?php   echo Form::select('parent_id', 'none', $parent)  ;  ?>

    how to pass parameter selected?
  • The second parameter is used to identify the value or values to select. See http://docs.fuelphp.com/classes/form.html#/method_select
  • I of course read the documentation but still does not work.
    here is an example from the documentation
    <?php<br />echo Form::select('country', 'none', array(
    'none' => 'None',
    'europe' => array(
    'uk' => 'United Kingdom',
    'nl' => 'Netherlands'
    ),
    'us' => 'United States'
    ));
    ?>

    simple question
    how to apply to the line 'us' =>'United States'
    attribute selected
  • HarroHarro
    Accepted Answer
    As I said, the second parameter is the selected value (or values):

    <?php<br />echo Form::select('country', 'us', array(
      'none' => 'None',
       'europe' => array(
         'uk' => 'United Kingdom',
         'nl' => 'Netherlands'
       ),
      'us' => 'United States'
    ));
    ?>

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion