Jump to content

KeyValue Form Helper - Define field types.


Recommended Posts

Yes, I am fully aware I can do this by extending the KeyValue form helper class. Every, single, time I want to use something not a text input for the key or value. Can we pass this as an option like 'keyFieldType' and 'valueFieldType', defaulting to Text instead, and pass the field type specific options through to them with something like 'keyFieldOptions' and 'valueFieldOptions' please?

For reference, I often use this field with the Stack field type, so such a change would need supported with this field type as well to be of value.

For example:

$form->add( new \IPS\Helpers\Form\Stack( 'my_setting', $values, true,
    [ 'stackFieldType' => 'KeyValue', 'keyFieldType' => 'Url', 'valueFieldType' => 'YesNo' ] ) );

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...