Fabriciojf.com Wiki
  • FAQ
    • APIs
      • FAQs Favoritos

        Qual é a sua dúvida?

        •  Página inicial do FAQ
        • Cake PHP
        • Valores default em inputs Cakephp2

        Valores default em inputs Cakephp2

        Checkbox

        $options = array(
        1 => 'Option 1',
        2 => 'Option 2',
        3 => 'Option 3',
        4 => 'Option 4'
        );

        $selected = array(
        1 => 'Option 1',
        2 => 'Option 2'
        );

        echo $this->Form->input('field', array(
        'type' => 'select',
        'multiple' => 'checkbox',
        'options' => $options,
        'selected' => $selected
        ));

        Combobox

        $options = array(
        1 => 'Option 1',
        2 => 'Option 2',
        3 => 'Option 3',
        4 => 'Option 4'
        );

        $default = 3;

        echo $this->Form->input('field', array(
        'type' => 'select',
        'options' => $options,
        'default' => $default
        ));

        RadioButton

        $options = array(
        1 => 'Option 1',
        2 => 'Option 2',
        3 => 'Option 3',
        4 => 'Option 4'
        );

        $default = 3;

        echo $this->Form->input('field', array(
        'type' => 'select',
        'options' => $options,
        'default' => $default
        ));

        Text

        echo $this->Form->input('field', array(
        'type' => 'text',
        'value' => 'text value for input'
        ));

        Textarea

        echo $this->Form->input('field', array(
        'type' => 'textarea',
        'value' => 'text value for input'
        ));
         Página inicial do FAQ
        • FAQ
          • APIs
            • FAQs Favoritos

              © Copyright 2025 Fabriciojf.com  Criado por FábioCostaMKT   Pastes   Administração