Hi, I’m trying to build an Express Object Form in a single page controller. This code works:
$form = $object->buildForm(‘Form’);
$form->addFieldset(‘Basics’)
->addAttributeKeyControl(‘page_name’)
->addAttributeKeyControl(‘parent_page_path’);
$form->save();
So I expected I could do this as well:
$form = $object->buildForm(‘Form’);
$form->addFieldset(‘Basics’);
$form->addAttributeKeyControl(‘page_name’);
$form->addAttributeKeyControl(‘parent_page_path’);
$form->save();
but that bombs out with a error: error":{“type”:“Error”,“message”:“Call to undefined method Concrete\Core\Express\ObjectBuilder\FormBuilder::addAttributeKeyControl()”,“code”:0,“file”:
What I had be hoping to do was add the attribute control keys in a foreach, something like:
$form = $object->buildForm(‘Form’);
$form->addFieldset(‘Basics’);
foreach($handles as $handle){
$form->addAttributeKeyControl($handle);
}
$form->save();
I’ve been coming back to this problem for over a year now and would like to finally get it figured out as I am upgrading all my packages for Concrete 9.cx and PHP 8x. If anyone can point me in the right direction it would really be appreciated.
Thanks