Welcome Guest, Not a member yet? Register   Sign In
Simple View Controller for beginners.
#6

In application/config/routes.php:
PHP Code:
$route['default_controller'] = 'home'// 'welcome' is another popular choice 

Then add application/controllers/Home.php:
PHP Code:
<?php

class Home extends MY_Controller
{
 
   public function __construct()
 
   {
 
       parent::__construct();

 
       // Load additional helpers and libraries; language file
 
   }

 
   public function index()
 
   {
 
       // Setup your index page
 
   }


The index method in your home controller then becomes available at the following locations (assuming you have rewrite configured properly and index.php removed from your URLs):
http://mysite.com/
http://mysite.com/home
http://mysite.com/home/index
Reply


Messages In This Thread
RE: Simple View Controller for beginners. - by mwhitney - 03-05-2015, 06:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB