5

Can u confirm if the layout xml file im using is of the proper format

routerfrontname_controllerfrontname_controlleraction.xml

Eg:

routes.xml

<router id="standard">
    <route id="something" frontName="s"/>
</router>

Controller path:

Controller/Result/Index.php

Then my layout file will be as :

s_result_index.xml? Am I correct.

1) Can the "route id" and "frontName" be different?

2) If it is different too, then we use route frontname (ie 's' in my case). Correct?

4

Front name and route id can be different, but then you should use id in file names.

Correct format is: routerid_controllerfrontname_controlleraction.xml

So it should be something_result_index.xml.

|improve this answer|||||
  • 1
    I think you meant to type routeid not routerid. – thdoan Feb 16 '17 at 10:40
  • how about the camelCased controller action names, like: MyAction, that is converted to routerid_countrollerfrontname_my-action or routeid_countrollerfrontename_myaction ? – Elzo Valugi Apr 11 '18 at 11:26
  • can frontname be front_name? what would be the layout name in this case? – Abhilash Acharya May 16 '19 at 9:41

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.