2

I want to do these codes like in magento 1

$request->setModuleName('catalogsearch')
        ->setControllerName('advanced')
        ->setActionName('result');

and then the page load content page like catalogsearch/advanced/result/ page. but Url still keep old url like /abc/xyz.html

3

2 Answers 2

2

try from controller


$request = $this->getRequest();
        $request->getModuleName('catalogsearch');
        $request->setControllerName('advanced');
        $request->setActionName('index');

2

I just done with this

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        //get request object
$requestOb = $objectManager->get('Magento\Framework\App\Request\Http');
$requestOb->setRouteName('catalogsearch')
    ->setControllerName('advanced')
    ->setActionName('result');

Not the answer you're looking for? Browse other questions tagged or ask your own question.