Skip to content

Use the same source multiple times #58

@NicolasRoehm

Description

@NicolasRoehm

Hi Grégoire, as you described here, we cannot use a "source" more than once :

HTML

<form>
    <select name="home_template">
        <option value=""></option>
        <options source="templates" />
    </select>
    <select name="custom_template">
        <option value=""></option>
        <options source="templates" />
    </select>
    <!-- ... -->
</form>

PHP

$form = new Gregwar\Formidable\Form('forms/myform.html');
$this->form->source('templates', [ 'home', 'full-width', 'default' ]);
echo $form;

RESULT

<form method="post">
    <select name="home_template">
        <option selected="selected" value=""></option>
    </select>
    <select name="custom_template">
        <option selected="selected" value=""></option>
        <option value="home">home</option>
        <option value="full-width">full-width</option>
        <option value="default">default</option>
    </select>
    <!-- ... -->
</form>

Will it be possible to do so ? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions