0

I have this page: [magento2.emthemes.com/everything/women/tops-women.html].
When i click on the fillter on the left i will get this link:[magento2.emthemes.com/everything/women/tops-women.html?cat=2‌​3] . It has param_value = tops-women.html, query_string_name=cat, query_string_value=23. In generality, what is the param_value for that?
Example: I have code into Controller, in this case param_value=data ($data = $this->getRequest()->getParam('data');):

class Index extends \Magento\Framework\App\Action\Action { public function execute() {
$this->_view->loadLayout();

    $data = $this->getRequest()->getParam('data');
    $data = base64_decode($data);
    $data = json_decode($data);
    $result = array();
    if($data){
        foreach($data as $key => $value)
        {
            $result[$key] = $value;
        }
        $block = $this->_view->getLayout()->createBlock($result['type']);
        $block->setData('current_url',$data->current_url);
        if(!$this->_view->getLayout()->getBlock('formkey')){
            $this->_view->getLayout()->createBlock('Magento\Framework\View\Element\FormKey','formkey');
        }
        //echo "<pre>";echo $block->toHtml();die;   
        $block->setData($result);   
        $block->setData('uniqueId',uniqid());
        $this->getResponse()->setBody($block->toHtml());
    }
}

}

2
  • @Atish Goswami: I have created a new question. Sep 16 '16 at 11:05
  • use $this->getRequest()->getParam('cat') Sep 16 '16 at 11:18
0

You can also use like this

$cat = $this->getRequest()->getParam('cat');

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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