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

Marcus

Well-known member
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.webp
 
OK sure its a listener. Where would you put in the listener for this class?
In VirtualForums/Prefixlistener or in VirtualForums/Route/Prefix/Listener ?
 
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.
 
I know, but is there a common practice for naming listeners according to what they are listening to?
 
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.
 
Top Bottom