Beruflich Dokumente
Kultur Dokumente
College / Department:
LabExer No. 1
Online Education
Introduction
Hello World
Step 1. Install CodeIgniter Framework on your root directory or your project folder.
Example:
If you are using WAMP Server
Root Directory: C:\wamp\www
Project Folder Directory: C:\wamp\www\project_folder
If you are using XAMPP Server
Root Directory: C:\xampp\htdocs
Project Folder Directory: C:\xampp\htdocs\project_folder
Step 2. Test if you’ve set it up correctly
Open your Browser and type in localhost/project_folder on the address bar.
1
Course Code IT342
College / Department:
LabExer No. 1
Online Education
If not, make sure your server is online and running correctly. Check your apache configurations.
Using a code editor, type the following codes and name it as Home.php.
College / Department:
LabExer No. 1
Online Education
When creating CodeIgniter controllers, you must extend the CI_Controller. It extends the
CI_Controller class methods that you can use on your newly created controller.
The index function or method (it is called method because it is on the class) will be called if
the Home controller was requested on the browser when there is no method specified.
3
Course Code IT342
College / Department:
LabExer No. 1
Online Education
You might be wondering why the index method loads when it is called by
http://localhost/index.php/Home
And that is should be
http://localhost/index.php/Home/index
The Answer is: Well it works both ways.
Machine Problem
Create a program using CodeIgniter that will display the corresponding text when a method is called.
1. Method: Products
2. Method: About Us
3. Method: Contact Us
4. Method: FAQ
====================================
4
Course Code IT342
College / Department:
LabExer No. 1
Online Education
=================================
Welcome screen:
==============================
Below are the results. I used port 8080 for the apache, cause I having trouble using port 80.
http://localhost:8080/index.php/Home
5
Course Code IT342
College / Department:
LabExer No. 1
Online Education
====================
http://localhost:8080/index.php/Home/about
==============
6
Course Code IT342
College / Department:
LabExer No. 1
Online Education