This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

milozo62941
milozo62941

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

mjauvin
mjauvin

Can you give more details on what you want to achieve? Where do you call this "onCheckEmail"?

JeffGoldblum
JeffGoldblum

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

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.