CodeIgniter Forums
HOOK post_controller_constructor, exclude specific controller form execution - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: HOOK post_controller_constructor, exclude specific controller form execution (/showthread.php?tid=33378)



HOOK post_controller_constructor, exclude specific controller form execution - El Forum - 08-24-2010

[eluser]Atas[/eluser]
Hello, does anybody know how to exclude a specific controller from hook post_controller_constructor execution , any ideas ?

Thanks !


HOOK post_controller_constructor, exclude specific controller form execution - El Forum - 08-24-2010

[eluser]danmontgomery[/eluser]
Code:
$CI =& get_instance();
if($CI->router->class == 'class_to_exclude') {
    return;
}

// Do things



HOOK post_controller_constructor, exclude specific controller form execution - El Forum - 08-24-2010

[eluser]Atas[/eluser]
Hi noctrum, where do i need to put that code ?

Thanks!


Update: oh ! in the hook ... ok...


HOOK post_controller_constructor, exclude specific controller form execution - El Forum - 08-24-2010

[eluser]danmontgomery[/eluser]
Yep, in your post_controller_constructor hook


HOOK post_controller_constructor, exclude specific controller form execution - El Forum - 08-24-2010

[eluser]Atas[/eluser]
Thank you very much !