If i try this:

<a href="http://shopname/admin/customer/index/edit/id/1/"></a>

it'll return to the dashboard.

1 Answer 1


The admin uses some secret keys in the URL generated based on the URL and a random string that depends on the session in order to avoid CSRF attacks.

But you can generate the url to the customer edit page in a block or template on the admin side like this:

$url = $this->getUrl('customer/index/edit', ['id' => 1]);
  • Thanks, this works in template and block, but in controller no. How i can do it in controller? I tried $this->urlBuilder->getUrl('customer/index/edit', ['id' => 1]); but return a bad url
    – Paolovox
    May 22, 2017 at 14:33

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.