Welcome Guest, Not a member yet? Register   Sign In
Hooks Not Working Correct
#1

(This post was last modified: 01-29-2016, 01:49 AM by wolfgang1983.)

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




Theme © iAndrew 2016 - Forum software by © MyBB