So I am working on it first time. I created a Controller
DB_DuhController having a method
I am then calling it as
http://domain.craft.dev/admin/DB/duh/Foo but it's giving
404 all the time. What is wrong being done by me?
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.Sign up to join this community
You need to use
/actions (or whatever your Trigger word is) to access Controller actions.
EDIT: I realize I wasn't clear enough; this variable defaults to
/actions. Unless you've set it to something else in your Config, add the
/actions to your URL to access the Controller action.
So, your URL would be this:
Note that capitalization matters.
It's also important to make sure that if you plan on making calls to this URL from outside Craft, you'll need to make sure that you're allowing anonymous access by setting that variable at the top of your controller:
protected $allowAnonymous = true;