If I have a control panel page and I want to submit it to a PHP page in my extensions' directory, how do I do that? What would the URL be?
Or would I instead make an
ACT URL? If so, how do I do that on the control panel side of EE?
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.Sign up to join this community
You shouldn't be submitting to PHP file in system folder directly, as the system folder might be located outside of web root and so inaccessible for direct requests.
Instead you need to place those functions inside of a module and post data to
ACT page, just like you say.
The function reference need to be added to
exp_actions database table (see example in the docs)
Then to get URL to post to you will need code similar to this:
$act = ee()->db->select("action_id")->from("actions")->where("class", 'Module_name')->where('method', 'function_name')->get(); $remoteUrl = trim(ee()->config->item('site_url'), '/').'/?ACT='.$act->row('action_id');