How to create new page in codeigniter?



How to create new page in codeigniter?..

Answer / Charu Gupta

To create a new page in CodeIgniter, follow these steps:

1. Create a new PHP file for your controller (e.g., welcome.php) inside the 'controllers' folder.
2. Define the class name and extend it from CI_Controller (e.g., class Welcome extends CI_Controller).
3. Create a method to display the view (e.g., function index()).
4. Load the view by using the load() method of the $this object (e.g., $this->load->view('welcome_message', $data)).
5. In your application/views folder, create a new PHP file for the view (e.g., welcome_message.php).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CodeIgniter Interview Questions

What is the latest version of codelgniter? Lists its new features.

1 Answers  


What is hooks and how we can configure hooks in codeigniter?

1 Answers  


Explain how you will load or add a model in codeigniter?

1 Answers  


How do I migrate my existing 'normal' php site to codeigniter?

1 Answers  


What is route in codeigniter?

1 Answers  


Is codeigniter secure?

1 Answers  


How can you create a library in codeigniter?

1 Answers  


What are the hooks in codeigniter?

1 Answers  


What do you mean by get_instance in codeigniter?

1 Answers  


What is hooks in codeigniter?

1 Answers  


What is csrf attack in codeigniter?

1 Answers  


How to set or get config variables in codeigniter?

1 Answers  


Categories