RE: How to load a view in CodeIgniter?

How to load a view in CodeIgniter?

dip Team Leader Asked on June 7, 2018 in CODEIGNITER.
Add Comment
1 Answers

Load View:

To display the view on the screen need to load the view from the controller using $this -> load ->view() method

Pass the name of view file in the method

Eg:

$this -> load ->view(‘your_view_page’);

Pass Data to View

To also pass the value to the view for this create an Array and initialize the values and pass in the method with view name e.g

$this -> load ->view(‘your_view_page’,$data);

 

Senior Developer Answered on July 3, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.