CStrategies
Member
I get most things in XenForo but routes drive me mad.
I have added a custom action method to my extension of the XFRM resourceitem public controller.
Here is the format of the extension:
I know the extension works, because I have other methods I already use in that extension.
Here is how I tried to set up my route in ACP:
I've also tried simply:
I always get the same error:
Any help to understanding what I am doing wrong and why it's wrong would be greatly appreciated!
I have added a custom action method to my extension of the XFRM resourceitem public controller.
Here is the format of the extension:
Code:
<?php
namespace My\Addon\XFRM\Pub\Controller;
use XF\Mvc\ParameterBag;
use XF\Pub\Controller\AbstractController;
class ResourceItem extends XFCP_ResourceItem
{
public function actionMyAction(ParameterBag $params) {
}
}
I know the extension works, because I have other methods I already use in that extension.
Here is how I tried to set up my route in ACP:
Code:
Route type: Public
Route Prefix: resources
Sub-name: my-action
Route Format: my-action/:int<resource_id,title>/
Controller: My\Addon\XFRM:ResourceItem
Action Prefix: myaction
Add-on: My Addon
I've also tried simply:
Code:
Route type: Public
Route Prefix: my-action
Controller: My\Addon\XFRM:ResourceItem
Action Prefix: myaction
Add-on: My Addon
I always get the same error:
Code:
Error: Class 'My\Addon\XFRM\Pub\Controller\XFCP_ResourceItem' not found in src/addons/My/Addon/XFRM/Pub/Controller/ResourceItem.php
Any help to understanding what I am doing wrong and why it's wrong would be greatly appreciated!