As that page in the docs says, dedicated controller action URLs will look like:
http://example.com/actions/pluginHandle/actionName
If your plugin’s name is “CocktailRecipes”, and you have a controller located at plugins/cocktailrecipes/controllers/CocktailRecipesController.php, and within that you have a function called actionSaveIngredient()
, you would get to that via:
http://example.com/actions/cocktailRecipes/saveIngredient
If your controller is actually called CocktailRecipes_IngredientsController.php, it would be this instead:
http://example.com/actions/cocktailRecipes/ingredients/saveIngredient
Your plugin can also register a route (either CP-facing or site-facing) which could provide a cleaner endpoint for the controller:
public function registerSiteRoutes()
{
return array(
'saveIngredient' => array('action' => 'cocktailRecipes/ingredients/saveIngredient'),
);
}
If you had that in place, you’d be able to access CocktailRecipes_IngredientsController’s actionSaveIngredients() like this instead:
http://example.com/saveIngredient
Note: I don’t recommend trying to create a route for your controller until you’ve figured out how to get a basic action URL to point to it correctly. No need to add another step of complexity while you’re still troubleshooting.