Closed pavelsr closed 4 years ago
What you want should be possible already through the schema configuration:
use Mojolicious::Lite;
plugin Yancy => {
backend => '...',
read_schema => 1, # this will fill in the rest of the schema
schema => {
passports => {
properties => {
reg_address => {
title => 'Registration address',
description => 'Put a description here, it will appear',
},
},
},
};
The form plugins try to use the same information from the schema that the editor uses. All of the configuration here should work in the form plugin, too (though some of the more advanced fields are not yet implemented).
Also, it looks like the field_for()
helper does take a %opt
hash, it's just not documented ☹️. I'll fix the documentation. The %opt
hash takes the same keys as the schema (so, title
and description
).
E.g. I have a field which has following sql definition
I want that in form corresponding
<label>...</label>
will beRegistration address
(name
attribute untouched )For now I have following output of Yancy::Plugin::Form::input_for
yancy->form->input
%args
have no way to customize<label>
tag valueCurrently there is only
enum_labels
param used for just boolean fields that generate output likeIs there any undocumented way to customize label for other input types ?
If no, do you think that suggested feature would be useful ? If yes, I can try to make a PR.