Esempio n. 1
0
 public function afterConstruct()
 {
     $this->Language->findConditions = array();
     // setting I18N domain to use admin.po files
     $this->I18n->domain(null, 'admin');
     // Serve Mobile Content as soon m.[hostname] called or mobile browser requested
     if (substr($this->request->header->get('host'), 0, 2) == 'm.' || $this->Browser->isType(BrowserTypes::MOBILE) || !empty($this->request->data['mobile'])) {
         $this->layout = 'mobile';
         $this->data->set('isMobile', true);
     }
     return parent::afterConstruct();
 }
Esempio n. 2
0
 public function afterConstruct()
 {
     $this->registerCallback('beforeView', array($this, 'beforeView'));
     return parent::afterConstruct();
 }