At first I was doing this directly in the connector.php file, which worked fine but I decided I wanted to do it the proper way. So I moved all the code into the process() function in this modifyEvent.class.php file, which I’ve cobbled together from examples on the Internet and suggestions from Claude. But when I make a call to the connector, all I ever get back is this:
How do you make the call?
If you don’t use Ext.js (MODx.Ajax.request()), I believe you have to supply the “modAuth” parameter.
Your code still looks a lot like MODX 2.x (with no namespaces).
Also, you don’t need a custom connector. You can call a custom processor using the default MODX-connector, if you supply the fully-qualified class name as the “action” parameter.
I am using a namespace for my custom model ($namespace = "FBECEvents\\Model\\";) but I guess that’s not exactly what you mean? If you could point me to a tutorial for the 3x way of doing it, or a simple example of it, I’d be very appreciative.
Oh yeah? That could be handy. Do I just call /connectors/index.php instead of /assets/components/fbecevents/connector.php and pass something like components/fbecevents/processors/modifyEvent for the action parameter?
This is very helpful; thank you! I’m making progress but I think I have something wrong with my pathing. The error I’m getting now is Requested processor not found. I’m passing action: FBECEvents\Processors\ModifyEvent . Here’s a screenshot of my directory structure:
Assuming you have a standard bootstrap.php file that uses the “src” folder as the path for addPackage(), you have to put your processors in the “src” folder as well (so that the autoloader works).
Then the folder structure inside “src” defines the namespace of a class:
Your custom class fbecEvent is inside the Model folder, so the fully qualified name is FBECEvents\Model\fbecEvent.
If you put the processor inside a Processors folder, then the namespace is FBECEvents\Processors and the fully qualified name of your class is FBECEvents\Processors\ModifyEvent.
Also make sure that the processor file has the same name as your class (check the capitalization) and ends in .php instead of .class.php.
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.