All,
I have the following project setup in Zend’s mvc Framework. Upon accessing the application, I want the user to redirect to “mobile” module instead of going to IndexController in “default” module. How do I do that?
-billingsystem
-application
-configs
application.ini
-layouts
-scripts
layout.phtml
-modules
-default
-controllers
IndexController.php
-models
-views
Bootstrap.php
-mobile
-controllers
IndexController.php
-models
-views
Bootstrap.php
Bootstrap.php
-documentation
-include
-library
-logs
-public
-design
-css
-images
-js
index.php
.htaccess
My index.php has the following code:
require_once 'Zend/Application.php';
require_once 'Zend/Loader.php';
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()->run();
you have two options :
1- set
mobileas default module for your application by editing your application.ini fileresources.frontController.defaultModule = "mobile"2- you can create a plugin that intercept every request and forward to the same controller and action but to the mobile module
and don’t forget to add the error controller to the if clause so you don’t end up with mysterious loop when your application throws an error , and that is it