CodeIgniter View

  1. A view is a web page that display all the elements of User Interface. View deals with the fronted operations. View display data and capture user action. View send user action to controller. Location of  all view files is applications/views.

View could not be called directly. You need to load the view through controller.

How to create view

Create a HTML page and name it firstview.php. Save this file inside  applications/views.
Code of the firstview.php file.

Load the view

View will be load through controller.  Syntax for loading view will be :

For our case syntax will be :

Load multiple views in Controller

You can also create a new folder inside application/view and save your files in this folder.

Sort views in Subfolders

You can  sort views within subfolders:

Pass Dynamic Data to view

Data can be transfer from controller to view by using an array or object.

View will be look like this :

Anuj Kumar

I'm Anuj kumar a web developer with 4+ year experience .I write blogs in my free time. I love to learn new technologies and share with others. I founded PHPGurukul in September 2015. The main aim of this website to is provide php , jquery , mysql , phpoops and other web development tutorials. I am trying best effort to make PHPGurukul useful for every single moment spend on this website. If you think this website is useful to visit please share with your friend and buddies.

Recommended Tutorials for you

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *