CodeIgniter Forums
extending hooks - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Best Practices (https://forum.codeigniter.com/forum-12.html)
+--- Thread: extending hooks (/thread-64870.html)



extending hooks - Tecvid - 04-06-2016

hi everyone! i need advice.. i have decided to collect all my hooks in one class, like this:
PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

// ------------------------------------------------------------------------

/**
 * Hooks Class
 */
class Hooks extends CI_Hooks {
    
    
/**
     * Some method
     */
    
protected function some_method()
    {
        
//
    
}
    
    
// ------------------------------------------------------------------------
    
    /**
     * Another method
     */
    
protected function another_method()
    {
        
//
    
}
    
    
// ------------------------------------------------------------------------
    
    // etc...
    


but in order to make method protected, i have extended the CI_Hooks, so is it a good? or i shouldn't do like this?