![]() $field_set->getField('address2', 'action_button')->setText('Hello') $field_set->getField('address1', 'text') $field_set = $field_group->getFieldSet('Address') $field_group = $form->getGroup('Contact details') $field_set->getField('number', 'number')->params()->setRequired(true) $field_set = $field_group->getFieldSet('number') >setPlaceholder('Your Email = $field_group->getFieldSet('color') $field_set = $field_group->getFieldSet('email') $field_group = $form->getGroup('Custom Input Example') Create tab called "Custom Input Example" $field_set->getField('last_name', 'text') $field_set = $field_group->getFieldSet('Last Name')->withButton('Click Me') notice that where adding a button with the Last Name ![]() $field_set->getField('first_name', 'text') $field_set = $field_group->getFieldSet('First Name') Now add a "First Name" and "Last Name" field $field_group = $form->getGroup('header 1') Create our first Tab called "header 1" The new Shared Form View is included with ExpressionEngine 6.4 and above and allows developers to create Shared Form Views using an object interface instead of dealing with arrays. #expressionEngine #eecms- ExpressionEngine May 31, 2022 ![]() This community effort will make using the Shared Form View so much easier. It's awesome to wake up and see this PR come through! So the community did just that, and the new CP\Form library is the result. And, also, the docs need work.”, which lead to someone just throwing out there, “Let’s maybe build a better way?”. The end consensus of which was, “We like the uniformity of the output, wish there were more options for customization if we’re being honest, but really don’t like having to scroll through hundreds of lines of nested array code to find the field we want to modify. In fact, they were so not wrong that the entire discussion was moved to a private channel (by the mods) so the problems could be talked out. How, “nested arrays are painful” and “wow, that’s a lot of code though”. It can increase mental costs debugging errors. The community pointed out that the Shared Form can get complicated for large forms. And, oh boy, did they have a lot to say about it, and it was all on point. People starting talking about Shared Form in the ExpressionEngine Slack channel. The reaction was not what I had thought it’d be… Even wrote 3 articles explaining and showcasing how easy Shared Forms are, to boot. Define a data structure, pass it to a view array, and you’re done. I really like the Shared Form functionality.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |