Creating views in Codeigniter

A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. Views are stored in application/views/ directory. Let’s create a view.

Example (first.php) The view file

<title>My first view</title>
	<h1>Welcome to my first view</h1>

Example (Hello.php) The Controller file

class Hello extends CI_Controller {
	public function index()


URL : http://localhost/myApp/index.php/Hello
Output : Welcome to my first view

Directory Structure



You may also like...