• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

search_start Listener

dbembibre

Active member
#1
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
 

tyteen4a03

Well-known member
#2
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 :)
 

dbembibre

Active member
#3
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
 

tyteen4a03

Well-known member
#4
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.
 

dbembibre

Active member
#5
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:

Jeremy

Well-known member
#6
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.