Questions tagged [controller]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
101 views

Where do I begin troubleshooting a Form in Craft that is redirecting to /login on iPad and iPhone?

I'm not sure how to ask this question. I have a form. It works just fine on desktops. However when the form is submitted on iPhone or iPad it never makes it to my controller and resolves to the URL /...
2
votes
2answers
1k views

How to create a basic plugin front-end controller?

I'm trying to create a very simple controller from a "foo plugin", but it seems there is something i did not understand because i can't make it work. (404 error) I looked at contactForm plugin as an ...
5
votes
1answer
939 views

Should my controllers actions 'return' when rendering templates?

When developing a plugin, I am registering routes to controller actions. Other frameworks, read that as Laravel, typically return the controllers response. public function showProfile($id) { $...
5
votes
1answer
214 views

Plugin routing casing: camel, lower, Pascal

Recently got tripped up with plugin routing due to casing. It seems when you're in the control panel, your "plugin handle" is lower-cased in routes, though both seem to work: /cp/settings/plugins/...
3
votes
1answer
901 views

How do I access AJAX data within a controller method?

I have a JavaScript file which sends an array of data to a controller: Craft.postActionRequest('wineNotes/wineSpreadSheet/saveWines', data, ...) The structure of the data variable is as follows: ...
8
votes
1answer
1k views

How do I handle named route variables passed to a controller?

I'm writing a plugin that uses the registerSiteRoutes hook to create some new routes, and passes those routes to some controllers. In these routes, I have a few pieces of the URL that I'm capturing as ...