search_start Listener

dbembibre

Active member
Sorry if is a stupid question, im not a programmer, but i cant found this.
Im trying to migrate my own vb3 plugin to restrict to certain groups the search function when the server load is high. In vb have a "search_start" hookname, exist something similar in xf ??

Thanks a lot for you patience with my questions :D
 
Sorry if is a stupid question, im not a programmer, but i cant found this.
Im trying to migrate my own vb3 plugin to restrict to certain groups the search function when the server load is high. In vb have a "search_start" hookname, exist something similar in xf ??

Thanks a lot for you patience with my questions :D
XenForo does not use a hooking system. Instead, you directly override classes.

Override XenForo_ControllerPublic_Search::actionIndex() and actionSearch() and add your SLA checking code there. If you need starter boilerplate code let me know - I assume you know how to extend existing classes correctly :)
 
XenForo does not use a hooking system. Instead, you directly override classes.

Override XenForo_ControllerPublic_Search::actionIndex() and actionSearch() and add your SLA checking code there. If you need starter boilerplate code let me know - I assume you know how to extend existing classes correctly :)

Thanks a lot @tyteen4a03 yes i know how to extend the existing classes, but not what classes need to extend :D
 
Thanks a lot @tyteen4a03 yes i know how to extend the existing classes, but not what classes need to extend :D
XenForo's code is very developer friendly. If you have basic knowledge in MVC you should be able to find the class you need instantly.

Class names also match directory structure, so XenForo_ControllerPublic_Search exists under library/XenForo/ControllerPublic/Search.php as you would expect.
 
Great to know, i migrate a month ago from vb3.8 and im a little lost :) i release my first two little addons yesterday, but following the development tutorials :)
 
Last edited:
If you have debug enabled, you are also able to go directly to the routes to find the RoutePrefix which will in turn show you the controller that is being used.
 
Back
Top Bottom