route defined in module.config.php as follow:
'router' => [
'routes' => [
'searchtop' => [
'type' => Hostname::class,
'options' => [
'route' => ':subdomain.:maindomain',
'constraints' => [
'subdomain' => 'so',
'maindomain' => 'somedomain.com',
],
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
'home' => [
'type' => Literal::class,
'options' => [
'route' => '/',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
],
'searchpcresult' => [
'type' => Literal::class,
'options' => [
'route' => '/pc/ss',
'defaults' => [
'controller' => Controller\SearchController::class,
'action' => 'pcsub',
],
],
],
'searchmresult' => [
'type' => Literal::class,
'options' => [
'route' => '/m/ss',
'defaults' => [
'controller' => Controller\SearchController::class,
'action' => 'msub',
],
],
],
],
],
],
],
When I use the following in my viewhelper like, error raise.
$view = $this->getView();
return $view->url($this->routeName, $this->paramsArr, ['query' => $queryArr]); // $this->routeName here is **searchtop/searchpcresult**