• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hooks Not Working Correct

#1
I have enabled hooks. 

And I use a pre_controller

PHP Code:
$hook['pre_controller'] = array(
 
   'class' => 'Maintenance',
 
   'function' => 'index',
 
   'filename' => 'Maintenance.php',
 
   'filepath' => 'controllers/common/',
); 

PHP Code:
<?php

class Maintenance extends CI_Controller {

    public function 
index() {
        if (
$this->config->item('maintenance') == TRUE) {
            
$this->load->view('theme/default/template/common/maintenance_view');
        }
    }


When the maintenance config item is true it should over ride the current view and display maintenance view. But does not still displays the home controller view.

I have autoloaded my setting.php config file


PHP Code:
<?php

$config
['maintenance'] = TRUE


Then when is false should disable it.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.