This article focuses on the method of loading views in CI (codeigniter) http://www.php.cn/css/css-rwd-frameworks.html "target=" _blank > Frame view. Combined with the example form analysis of the CodeIgniter frame view loading related operation skills, the need for friends can refer to the following
This example describes how to load views in the CI (codeigniter) framework view. Share to everyone for your reference, as follows:
CI as a lightweight framework of PHP, its own many advantages, in this I would like to say is the view load view.
1: After setting the CodeIgniter database variable in the application\config\database.php file, set the underlying URL in the application\config\config.php file shortly thereafter. For example, my base URL is: localhost/codeigniter/
2: Next Create the default controller and view, create the Controller directory as: Application\controllers\ folder, create a controller named student.php. and set it as the default controller within the application\config\routes.php.
controller->student.php
Class Student extends ci_controller{public function construct () { parent::construct (); } Public Function Index () { $date [' title ']= ' classroom:home page '; $date [' Headline ']= "Welcome to the classroom Management System"; $date [' Include ']= ' student_index '; $this->load->view (' template ', $date); }}
views->template.php
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >< HTML xmlns= "http://www.w3.org/1999/xhtml" lang= "en" xml:lang= "en" >
view->student_index.php
Congratulations.your Initial setup is complate!
If you visit: Localhost/codeigniter/index.php/student/index
The result would output:
Welcome to the classroom Management Systemcongratulations.your initial setup is complate!