CodeIgniter Forums
Can I have more management on my controller by separate functions into classes? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Can I have more management on my controller by separate functions into classes? (/showthread.php?tid=71077)



Can I have more management on my controller by separate functions into classes? - hamidb80 - 07-03-2018

 created a simple "CMS" with "codeigniter".
I want to know can it separates public functions into a new class?
This is my controller code:



PHP Code:
class Admin extends MY_Controller {
 
   public function __construct(){}
 
   
    
// ---- POST ----
 
   public function addPost(){}
 
   public function editPost(){}
 
   public function deletePost(){}
 
   public function managePosts(){}
 
   
    
// ---- CATEGORY ----
 
   public function addCategory(){}
 
   public function editCategory(){}
 
   ...