Hi everyone,
(Sorry for my english)
I try to use hooks... It works but I've a small problem.
I said to my hook: IF condition OK -> do...
but I would like : IF condition not OK -> continue
When the condition is ok... it's good, the message is displayed and the application doen't continue...
but when the condition is not ok... I've a blank page ... I would like that the application continue normaly.
Someone to help me ?
Thanks
Marc
(Sorry for my english)
I try to use hooks... It works but I've a small problem.
I said to my hook: IF condition OK -> do...
but I would like : IF condition not OK -> continue
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Maintenance extends CI_Controller {
public function index ()
{
$this->CI =& get_instance();
$this->CI->options_params = $this->CI->m_options->get_options();
$off = new DateTime($this->CI->options_params[0]->off_ligne);
$today = date("Y-m-d H:i:s");
$now = new DateTime($today);
$interval = $now->diff($off);
$decal = $interval->format('%a');
$signe = $interval->format('%R');
if ($this->CI->options_params[0]->maintenance == 1 && $this->config->item('acces')[$_SERVER['mail']] === 'admin')
{
if ($signe === "-")
{
echo "<div> TOTO </div>";
}
}
}
}When the condition is ok... it's good, the message is displayed and the application doen't continue...
but when the condition is not ok... I've a blank page ... I would like that the application continue normaly.
Someone to help me ?
Thanks
Marc