Is there a way to add a collapsible header like the moodleform uses without using a moodleform? I want to use that element to contain a table with inplace_editable elements in it, but would like not to have to create it from scratch if I can use the existing moodle element.
Have a look at print_collapsible_region. Quite old code, but it still works I think.
Is there any documentation or an example on how to use print_collapsible_region that you know of? I'm looking into it, but don't see anything outlined in the Moodle docs.
Also, is there a way to expand/contract these regions afterward? Like on a form submit, can I snag the collapsible region by id and do a $region->expand(); or something?
An alternative is to use tabs
$rows = array(
new tabobject(...),
new tabobject(...)
);
echo $OUTPUT->tabtree($rows, $selectedid);