Search code examples
concrete5

Add to Form Results from External Form


Is there an API for adding to the Form Results that results from standard Forms are added to from an External Form?

I want to try avoid adding to the tables btform, btformanswers, etc. manually


Solution

  • No.

    See https://github.com/concrete5/concrete5/blob/master/web/concrete/core/controllers/blocks/form.php#L354-L415 -- the core's form block updates the table manually.

    As johjoh says, you could theoretically mimic a post to a form block, by instantiating it and then calling action_submit_form(), but that's just as fraught with difficulty, too... you'd have to keep the "form" in sync with your data, and possibly worry about the token and block ID and all that....

    What's your exact use case? New block type? Some sort of external API? The form viewing interface in the dashboard is nice, but nothing that special. I think most people want to get data out of it, not in....