public function err($msg) { if (!empty($this->controller->Session)) { $this->controller->Session->setFlash($msg); } else { return $this->Shell->err($msg); } }