Questions tagged [controller]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
203 views

Insert action in front of template, while maintaining entry slug

We are attempting to implement a number of Pardot forms within Craft templates. Since Pardot's form actions do not allow us to dynamically specify a return URL, our best choice is to use the form's ...
2
votes
1answer
1k views

Using the required field validation in custom element types/plugins?

I am finishing up the last few details on my custom element type. I have custom statuses and public submissions working. The last detail is providing validation on custom fields set through the field ...
6
votes
1answer
645 views

Allow anonymous submission on a custom element type?

I have a custom element type that I want to allow anonymous submission from the front-end. I have a solid concept on how the form data is passed but I seem to be missing something. I have the ...
1
vote
1answer
940 views

How to perform a redirect and pass on data?

I have a Controller Action which should pass on some data from one (CP) template to another: Template 1 (plugin/form): Form sends data Controller redirects data to Template 2 Template 2 (plugin/): ...
3
votes
1answer
1k views

How do I update a column value in my custom plugin with a simple controller?

I have a custom element type with its own table 'pluginname_entries'. I am trying to find a way to "dummy proof" changing the plugins status. So I came up, aka stole from the Events element type, with ...
7
votes
2answers
780 views

Best way to use custom enums in my plugin templates?

I am building a plugin that's uses an enum for custom statuses. The statuses are integrated within my plugin with the exception of changing the status in my template code. pluginname/enums/...
3
votes
2answers
2k views

Direct access to controller

I'm trying to create a plugin with a controller, but I don't want to render any view but run a script from a cronjob. I can't get into the controller with an url and I'm not sure why. I already ...
4
votes
1answer
1k views

Is the “registerSiteRoutes” hook screwing up my template path?

This may be a bug... I have a controller action which has been working great. It's a simple action with a single purpose... load a template with an internal value. public function actionMyAction() { ...
3
votes
1answer
102 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
957 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
229 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
934 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 ...

1 2
3