public static function setCache($cacheName)
 {
     $cache = Cache::getCache($cacheName);
     if (!$cache) {
         throw new \Exception('Invalid cache');
     }
     self::$_cache = $cache;
 }
 public function setCache($cacheName)
 {
     $cache = Cache::getCache($cacheName);
     if (!$cache) {
         throw new \Exception('Cache : "' . $cacheName . '" is not a valid cache');
     }
     $this->_cache = $cache;
     return $this;
 }
 public function __construct()
 {
     //check lang is in url and auto set
     if ($this->router->getCurrentRoute() == 'index' && stripos(Http::getCurrentUrl(), $this->language->getLanguage()) === false) {
         Http::redirect($this->router->getUrl('index'));
     }
     $this->tpl->setVar('langAvaible', $this->language->getLanguage() == 'fr_FR' ? 'en_EN' : 'fr_FR');
     //cache
     $this->_cache = Cache::getCache('bdd');
     $this->tpl->setVar('isConnected', Members::isConnected());
 }