Skip to content

BUG in form_hidden with associative array  #1244

Description

@bvrignaud

There is a bug in the form_hidden function declaration.

In the documentation (https://bcit-ci.github.io/CodeIgniter4/helpers/form_helper.html?highlight=form#form_hidden) we can read :
You can either submit a name/value string to create one field:

form_hidden('username', 'johndoe');
// Would produce: <input type="hidden" name="username" value="johndoe" />

... or you can submit an associative array to create multiple fields:

$data = array(
        'name'  => 'John Doe',
        'email' => 'john@example.com',
        'url'   => 'http://example.com'
);

echo form_hidden($data);

But the second way doesn't works.

The second parameters ($value) must have a default value.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions