Updating a plugin to Craft 3 (also changed its name). I know this is probably something very simple, like capitalization, but can anyone point out what's wrong?

Firefox console shows a 404 for
and then
Type error: Response is null

So perhaps Craft is getting the request, but $this->returnJson($response); isn't terminating the request, i.e. Craft continues to try to find a page to match?

My files are set up like this:



namespace Craft;
//namespace kr37\drycalendar\controllers;
use Craft;
use craft\base\Controller;
class DryCalendar_CalendarOccurrencesFieldController extends BaseController
    public function actionGenerateAjaxMiniCalendar() {

and in my Garnish js is

    function(response) {

Thanks for any help!

1 Answer 1


Craft 3 action routes are snake-case rather than camelCase thus your route needs to be plugin-handle/controller-handle/function-name instead of pluginHandle/controllerName/functionName

Your Controllers namespace must be prefix\namespace\name\controllers so in your case it could be kr37\drycalendar\controllers not Craft.

Furthermore you don't need to include your plugin name to the classname anymore. Your controller name can be


Your action will then be drycalendar/calendar-occurrences-field/generate-ajax-mini-calendar

Keep in mind you'll have to create routes of you don't use the action parameter in your request. Currently you are trying to access your controller via cp/site route, not via action route

  • Snake-case-was-it, thank you! I think, Robin, that you are rewriting my plugin for me. Very kind.
    – kr37
    Jun 13, 2018 at 5:40

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.