2

I've added custom controller under magento frontName and it works.

My routes.xml:

    ...
        <router id="standard">

            <route id="customer" frontName="customer">
                <module name="[Vendor]_[ModuleName]"/>
            </route>

        </router>
    ...

Path to controller is [Vendor]/Customer/Controller/Address/EditAjax and path in url is /customer/address/editajax. Is there any drawback or possibility of errors with native magento controllers

1 Answer 1

1

From my understanding, we can reuse the existing route. However, in some cases, our new controllers need to check the authentication. In your case, we need to check customer authentication. If we don't check anything and write the bad code, anyone can do the CRUD operations.

Luckily, Magento builds some abstract classes for checking security. In this case, our custom class should be extended from Magento\Customer\Controller\Address.

1
  • 1
    thank you for complete answer! +1 for iheritance hint Commented Nov 15, 2016 at 13:31

Your Answer

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

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