I have a form I’m creating, to enter data into a table that includes references to two other tables.
Table A is for widgets, includes fields for name, description, and price.
Table B is for groups, and is a relational table with its own index and fields for group name and widget id.
I want to make a form that displays form fields for widgets, but to the side has a table listing of groups for that widget. There are other tables that operate the same way and I’d like to create some reusable code.
- I can create the phtml file and reference everything specifically.
- I can create a custom view helper (I’ve done previously).
- I can create a partial to be used elsewhere (I’ve done this with common fields between multiple forms)
I’m looking for pros & cons, best practices (primary goal is reusable code), and any other recommendations you may have on the topic.