Custom controllers
Our system follows a simple MVC pattern which is straight forward and simple to understand. We've stripped out the complex design patterns to make the onboarding process and customization as simple as possible.
Let's supercharge what we have at the moment and build our very own customer management portal
The basic tenets for creating our own custom controllers is simple, we need to create.
- Custom controller
- Custom model
- Custom view
In order to use our pre-existing global themes we have saved in the system, we need to use a custom controller. Then we can easily use the existing theme data and pass it to our custom views.
<?php class Blog extends Ignitedcms { public function index() { // Now use theme global data in view $this->load->view('custom/name',$this->igsdata); } }
IMPORTANT: Make sure you create all your custom controllers in the controllers > custom directory and all you models in the models > custom directory and all the view files in the views > custom directory
You can go into PHPMyAdmin and create your own custom table (prefixed with the database prefix you choose during the installation process)
$query = $this->db->get('mytable'); foreach ($query->result() as $row) { echo $row->title; }