/** * Used to determine the last error in a session. * * In your controller: $this->Session->error(); * * @return string Last session error * @access public */ function error() { if ($this->__active === true) { $this->__start(); return parent::error(); } return false; }
/** * Returns last error encountered in a session * * In your view: `$this->Session->error();` * * @return string last error * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/session.html#displaying-notifications-or-flash-messages */ public function error() { return CakeSession::error(); }
/** * Helper method to set an internal error message. * * @param int $errorNumber Number of the error * @param string $errorMessage Description of the error * @return void */ protected static function _setError($errorNumber, $errorMessage) { if (self::$error === false) { self::$error = array(); } self::$error[$errorNumber] = $errorMessage; self::$lastError = $errorNumber; }
/** * Returns last error encountered in a session * * In your view: $session->error(); * * @return string last error * @access public */ public function error() { if ($this->__active === true && $this->__start()) { return parent::error(); } return false; }