I've read https://xenforo.com/xf2-docs/dev/routing-basics/ but can't quite figure out what I'm missing. I've set up a test controller, it shows up fine, but the ParameterBag doesn't get populated.
Controller:
View:
Route:
Result:
URL:
/test/1
Would appreciate any help into the right direction.
Controller:
PHP:
<?php
namespace Test\TestAddon\Pub\Controller;
use XF\Mvc\ParameterBag;
class TestController extends \XF\Pub\Controller\AbstractController
{
public function actionIndex(ParameterBag $params) {
$this->setResponseType('json');
$viewParams = [
'params' => $params,
];
return $this->view('Test\TestAddon:Test\TestView', '', $viewParams);
}
}
PHP:
<?php
namespace Test\TestAddon\Pub\View\Test;
use XF\Mvc\View;
class TestView extends View
{
public function renderJson()
{
return [
'params' => $this->params['params']
];
}
}
Result:
JSON:
{"params":{},"visitor":{"conversations_unread":"0","alerts_unread":"0","total_unread":"0"},"debug":{"time":0.0428,"queries":4,"memory":5.05}}
/test/1
$this->filter("test_id", "uint")
also results in 0.Would appreciate any help into the right direction.