This post refers to DotKernel 1, based on Zend Framework 1.
If you are looking for DotKernel 3 related posts, go here.

(Available since DotKernel 1.3.0)

The router.xml file stores the router settings. When talking about router settings, we mean modules, controllers (dots) and default actions. If you need other settings, feel free to update the file.

configs/router.xml has the following settings:

  • controllers – the controller(dots) for each module
  • route – stores the default controller for the modules and the default action for the controllers.

Note*: this file must be updated when you:

  • create a new module
  • create a new dots
  • or change the default action of the controller

In the sample below, frontend is the module, Page is the dots and home is the action

configs/router.xml sample code:

<?xml version="1.0" encoding="utf-8"?>
 <router>
     <!-- all controllers listed here-->
    <!-- 1. for whitelist approach & a secure autoload of all controllers-->
    <controllers>
        <frontend>Page</frontend>
        <frontend>User</frontend>
        <admin>Admin</admin>
        <admin>System</admin>
        <admin>User</admin>
        <rss>Sample</rss>
    </controllers>
     <routes>
         <!-- default controllers for modules -->
        <controller>
            <frontend>Page</frontend>
            <admin>System</admin>
            <rss>Sample</rss>
        </controller>
        <action>
            <!-- default action for controllers ... -->
            <frontend>
                <Page>home</Page>
                <User>login</User>
            </frontend>
            <admin>
                <Admin>account</Admin>
                <System>dashboard</System>
                <User>list</User>
            </admin>
        </action>
     </routes>
 </router>

One Comment

  1. DotKernel Reserved Variable Names for Caching | DotKernel PHP Application Framework

    […] Router is the object that load routes (modules, controllers, actions) settings from router.xml file. More info about router: http://www.dotkernel.com/docs/router-xml/ […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>