2

I need to add urldecode to the below function but unsure how to modify it so...

public function getAddFilterUrl($attribute)
{
    $filtering = $this->getRequest()->getParam('filtering', array());
    $filtering[] = $attribute->getAttributeCode();

    return $this->getUrl('*/*/*', array(
        '_current' => true,
        '_escape' => true,
        '_query' => array(
            'filtering' => array_unique($filtering)
        )
    ));
}

For example, the current URL outputted from the above is:-

/price_update/products/key/3b6f41cb95705740b8f46bbf1411a5e1/?filtering%5B0%5D=manufacturer

And what I want to output is:-

/price_update/products/key/3b6f41cb95705740b8f46bbf1411a5e1/?filtering[0]=manufacturer

I have tried modifying _escape in the array to no avail.

1 Answer 1

2

Surely you could

return urldecode($this->getUrl('*/*/*', array(
    '_current' => true,
    '_escape'  => true,
    '_query' => array(
        'filtering' => array_unique($filtering)
    )
)));

Or am I missing something?

1
  • No, not missing anything urldecode worked perfectly as per your answer. Thanks. Commented Apr 17, 2014 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.