I have a widget I’ve built to respond to particular URI: I had this working but have now forgotten what magic I used.
The widget has a link which looks like this:
/installer?action=deploy&which=calendar
This is intended to trigger the method: Installer::deploy( $which )
Currently this link results in a 404. My question is: Where should my installer.php file (containing the class) be placed so that th URL will be recognized?
As I said, I have had this working, but since then (about two months ago) I’ve messed up the Kirby installation and had to reinstall. Some change I have forgotten to make is missing.
You have a widget in the Panel Dashboard that has a link in it
When the user clicks the link you want to execute installer.php (which then does something relating to your plugin?)
When you install and test the link returns a 404, instead of executing installer.php
I’m a designer, not a programmer, but I’d:
make sure that installer.php is in /site/plugins directory and try re-writing your link to point to it, as maybe the router from panel dashboard assumes that’s the target?
permissions set to something that will allow the web server or kirby to execute a script wherever you have it located?
From my limited experience, I think Controllers are used to house logic for a specific page or template but plugins are for system or site wide services (you mentioned controller in your question)
My interest in this is somewhat self serving, as I’m loving Kirby a lot and like to build more sites with it, so I want to find out more about how plugins and the like are constructed.