Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a <select> form element by passing an associative array works too #56

Closed
Guustaaf opened this issue Apr 22, 2020 · 3 comments
Closed

Comments

@Guustaaf
Copy link

$select_element = [
"name" => "style_id",
"id" => "form_element_1",
"label" => "Style ID",
"options" => [
1 => "Abstract Expressionism",
2 => "American Realism",
3 => "Baroque",
4 => "Cubism"
],
"selected" => 2,
"value" => ''
];

echo $form->input_select( $select_element );

@Guustaaf
Copy link
Author

Something undocumented that works is not really an issue so I'm closing it.

@timgavin
Copy link
Member

I've added an example to the docs. Thanks!

@Guustaaf
Copy link
Author

I saw it. Thanks Tim. Good stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants