-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
CodeIgniter Web Application Blueprints
By :
We want to redirect the user to the create controller rather than the default CodeIgniter welcome controller. To do this, we will need to amend the default controller settings in the routes.php file to reflect this. The steps are as follows:
Open the config/routes.php file for editing and find the following lines (near the bottom of the file):
$route['default_controller'] = "welcome"; $route['404_override'] = '';
First, we need to change the default controller. Initially, in a CodeIgniter application, the default controller is set to welcome. However, we don't need that, instead we want the default controller to be create, so find the following line:
$route['default_controller'] = "welcome";
Replace it with the following lines:
$route['default_controller'] = "create"; $route['404_override'] = '';
Then we need to add some rules to govern how we handle URLs coming in and form submissions.
Leave a few blank lines underneath the preceding two lines of code (default controller...