Express: Adding form controls programatically

Permalink
I am able to create an express object, add attributes to that object, create a form with a set, and then set that form as the default form for both edit and view.

But I cannot for the life of me figure out how to get a form control to show up in the actual field set programatically.

You would think
$form->addFieldset('Basics')
    ->addAttributeKeyControl('first_name')
    ->addAttributeKeyControl('last_name')
    ->addTextControl('', 'This is just some basic explanatory text.')
    ->addAttributeKeyControl('bio');
$form = $form->save();
would also add an actual input for the attribute to the form. But it does not. Is this a bug, or is more code needed to get the actual inputs on the form! Yes I could go add the inputs manually via the dashboard, but there should be a way to do this programatically. Obviously the dashboard does it somehow.

How do I get my attributes to appear as inputs on my programmatically created express form?


Cross reference:
https://www.concrete5.org/community/forums/customizing_c5/cannot-add...
https://documentation.concrete5.org/developers/express/programmatica...
https://github.com/concrete5/concrete5/issues/5389...

ob7dev