| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- /**
- * 错误提示
- * User: ssh 2019.8.9
- * Date: 2019/8/9
- * Time: 16:47
- */
- namespace common\components;
- use Yii;
- class error
- {
- public $error = '';
- public $hasError = false;
- private static $instance = null;
-
- private function __construct()
- {
- }
-
- public static function instance()
- {
- if (empty(self::$instance)) {
- self::$instance = new self();
- }
- return self::$instance;
- }
-
- public function setError($msg)
- {
- $this->error = $msg;
- Yii::info($msg);
- $this->hasError = true;
- }
-
- public function getError()
- {
- return $this->error;
- }
-
- }
|