0

I'm writing my first Craft CMS plugin.

I have the following tag in my form:

<input type="hidden" name="action" value="clientnameDonation/donateForm/donate">

And then I have the following controller code to handle the action:

namespace Craft;

class ClientnameDonation_DonateFormController extends BaseController
{
    protected $allowAnonymous = array('actionDonate',
        );

    public function actionDonate()
    {
        // stuff
    }
}

When I try to submit the form, I get the following error:

Unable to resolve the request "clientnameDonation/donateForm/donate"

Is there a piece I'm missing, or is there a casing error somewhere?

I also tried just using a raw action URL like this:

http://URL/index.php?p=actions/clientnameDonation/donateForm/donate

I get the same routing error.

8
  • Can you try the URL minus the index.php?p=. That gets me depending on my local environment every now and then. Also, make sure the plugin is installed. May 20, 2016 at 17:22
  • This may sound insulting but have you installed the plugin? May 20, 2016 at 17:28
  • also, what is the file name of the controller? May 20, 2016 at 17:36
  • Believe me it's not insulting at all. I don't know how to "install" a plugin other than adding the folder with the correct plugin infrastructure to the plugins folder. Do I need to create a github repo of the plugin and actually install it that way? The file path of the controller is: craft/plugins/clientnamedonation/controllers/ClientnameDonation_DonateFormController.php May 20, 2016 at 18:12
  • 3
    You need to go into the control panel then 'Settings>Plugins'. If you've set it up correctly then you should see your plugin name in the list. Simply click "Install" and then your plugins file will be accessible from your templates. May 20, 2016 at 18:14

2 Answers 2

1

You may need to install your Plugin through the control panel. To do this go to 'Settings>Plugins' and if you've set it up correctly then you should see your Plugin name in the list.

Simply click "Install" and then your plugins file will be accessible from your templates.

2

I had the plugin set up correctly but I didn't go into the administration menu and install the plugin via the GUI.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.