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

Placing Form Fields inside layouts: Add "Region" parameter to addField #444

Closed
PhilippGrashoff opened this issue Apr 17, 2018 · 3 comments
Closed

Comments

@PhilippGrashoff
Copy link
Collaborator

Hi there,

a constant (and quite the only real) trouble I run into when using Agile UI is to place a Form Field exactly where I want it. When adding a field to a form with Form->addField(), I have no option to specify where this field should show, the standard Formlayout just displays the added fields first to last.
This led to some ugly workarounds I did to get the form fields where I want them in the layout.

An idea I just stumbled across which seems very sensible at first glance is to add a "Region" parameter to Form->addField(). Using this, regions could be defined in Form Template or Formlayout Template (I think the former would make more sense) and much more control over the form rendering could be easily achieved.

@romaninsh
Copy link
Member

you can add field like this:

$any_view = $form->add(['template'=>$tpl]);
$any_view->add([new FormField\Anything(), 'form'=>$form]);

@romaninsh
Copy link
Member

romaninsh commented Apr 17, 2018

See another example here: https://github.com/atk4/ui/blob/develop/demos/field2.php

@PhilippGrashoff
Copy link
Collaborator Author

That does the job, thanks again for these examples. Less puzzled now.

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