/ Published in: PHP

Basically, a simple way to use a templating system in
CodeIgniter. In your data array, add a view as the value for content. Pass that to the view, then print the $content variable in the view.
CodeIgniter. In your data array, add a view as the value for content. Pass that to the view, then print the $content variable in the view.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//In the controller: public function index() { $this->data['content'] = 'your-views-name'; $this->load->view('your-templates-name', $this->data); } //In the view: <?php $this->load->view($content); ?>
Comments
