This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I''m completely new to October. Where does code that calls plugin functions go?
For instance, if I'm using https://octobercms.com/plugin/rainlab-user
public function onCheckEmail() { return ['isTaken' => Auth::findUserByLogin(post('email')) ? 1 : 0]; }
where do I put it?
Do I write an extender
Thanks
Can you give more details on what you want to achieve? Where do you call this "onCheckEmail"?
If you want this AJAX handler to be available on a single page, you can include it in the code section of that page (https://octobercms.com/docs/ajax/handlers#ajax-handlers), if you want it to be available in multiple pages then you can put it in the code section of a layout or build a component to be included on all the pages / layouts that you want to have access to that handler on.
AJAX event handlers are PHP functions that can be defined in the page or layout PHP section or inside components.
1-3 of 3