开发者

Code Igniter: how can I use custom made Router

开发者 https://www.devze.com 2023-02-14 02:14 出处:网络
I have following code: class MY_Router extends CI_Router { function __construct() { parent::__construct();

I have following code:

class MY_Router extends CI_Router {  

     function __construct() {
        parent::__construct();
   log_message('debug', "My Chi开发者_C百科ld Router Class is here");
} }  

I have run the web page and saw log, but didn't find any log message there.

My purpose is that, instaed of default router, I want to use custom made router.

Can some one guide me what and where Iam doing wrong. And how it can be rectified.

Thanks in advance


If you are simply testing to see if the class if being constructed properly, it may be easier to just call an error message. If the error message displays then you're good to go.

show_error("My child router class is up and running.");

Also, ensure that your file is named "MY_Router.php" and is placed in your /application/core directory.

The user guide entry relating to extending core classes can be found at http://codeigniter.com/user_guide/general/core_classes.html

0

精彩评论

暂无评论...
验证码 换一张
取 消