We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Calling a module action

Development and Programming

orourkedd's avatar
orourkedd
1 posts
14 years ago
orourkedd's avatar orourkedd

I can call a module action in the control panel with this:

BASE.AMP . 'C=addons_modules&M=show_module_cp&module=module_name&method=add_record'

How do I create a module action that can be accessed on the front-end even by anonymous users? I want to use this action for ajax.

       
Rob Sanchez's avatar
Rob Sanchez
335 posts
14 years ago
Rob Sanchez's avatar Rob Sanchez

First you should create an action in your install method of the upd file:

function install()
{
    //etc...

    $this->EE->db->insert('actions', array('class' => 'Your_module_mcp', 'method' => 'add_record'));
}

Now, your add_record is accessible via the front-end with this url: http://yoursite.com/index.php?ACT=XX, where XX is the corresponding action_id from the exp_actions table.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.