3

I wanna create a page with custom url route. Do you have some references for me? I really frustated because stuck in two days.

I wanna create page like this:

www.myWeb.id/custom-route/

Please help me.

1 Answer 1

7

you can create new router from your module's config.xml

So create in your Films folder etc/, with in config.xml. config.xml contain:

<?xml version="1.0"?>
 <config>
 <modules>
    <Pfay_Films>
      <version>0.1.0</version>
    </Pfay_Films>
 </modules>
 <frontend>
   <routers>
      <routeurfrontend>
          <use>standard</use>
          <args>
             <module>Pfay_Films</module>
             <frontName>films</frontName>
          </args>
       </routeurfrontend>
   </routers>
</frontend>
</config>

You can learn from below links

https://www.pierrefay.com/en/magento-training/create-a-controller-tutorial.html http://inchoo.net/magento/programming-magento/magento-hello-world-module-extension/

and for more information on router

https://www.atwix.com/magento/create-custom-router/

http://inchoo.net/magento/custom-router-in-magento/

2
  • How can i write PHP script on that page? eg: www.myWeb.id/custom-route/ how to to write php script in custom-route?
    – zus
    Dec 6, 2019 at 7:21
  • You need to create controller file check here you to create router and controller inchoo.net/magento/programming-magento/… Dec 6, 2019 at 8:35

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.