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

load_class_route_prefix: "Cannot load class using XFCP. Load the class using the correct loader fir

Marcus

Well-known member
#1
I want to add a "&node_id=..." to my virtual forums.


This is the class (the editor here does not keep tabs from my windows notepad as well as eclipse):
PHP:
<?php
class VirtualForums_Route_Prefix_Threads extends XFCP_VirtualForums_Route_Prefix_Threads
{
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
$response = parent::buildLink();

if(isset($response->params['data']['myforumId']))
{
$response->params['extraParams']['node_id'] = $response->params['data']['myforumId'];
}

return $response;
}

}
screenshot.JPG
 

Marcus

Well-known member
#3
OK sure its a listener. Where would you put in the listener for this class?
In VirtualForums/Prefixlistener or in VirtualForums/Route/Prefix/Listener ?
 

Jeremy

Well-known member
#4
You can place it wherever you want, just make sure the listener class is properly named, that the function is static, and that you assign it in the event listener.
 

tyteen4a03

Well-known member
#7
I know, but is there a common practice for naming listeners according to what they are listening to?
Mine is: Things_Listeners_LoadClasses::eventNameHere(_eventHint) or Things_Listeners::eventNameHere(_eventHint).

I would use Things_Listeners_eventNameHere::fire(_eventHint) for a lot of code, but I haven't had this need yet.