2. Displaying home page

Easy Steps:

1.     On your notepad++, create a file named home_view.php, save it to: C:\xampp\htdocs\application\views and type the following:
<html>
<head>
<title>Home | BizjobFinder</title>
</head>
<body>
<h2>Welcome to BizjobFinder Home Page.</h2>
</body>
</html>

2.     Create another file named home.php, save it to: C:\xampp\htdocs\application\controllers and type the following:
<?php
/*
*Filename:home.php
*projectname:bizjobfinder.com
*Date created:April 02,2012
*Created by:Mario T. Silvano
*/
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class home extends CI_Controller{

      function index(){
                  $this->load->view('home_view');
      }
}
/*End of file home.php*/
/*Location:./application/controllers/home.php*/

3.     Open routes.php located on: C:\xampp\htdocs\application\config, and edit it.
$route['default_controller'] = "home";

4.     Let us put your code to the test, type localhost on your browser and you will see like this:


5.     Well done. CongratsJ

No comments:

Post a Comment