<?php
namespace app\components;

use Yii;

class WarningHelper{
	
	public static function warning($text, $link){
		if(empty($text)){
			$text = "发生未知错误";
		}
		$html = file_get_contents(Yii::$app->basePath . "/views/warning/index.php");
		$html = str_ireplace("{#errmsg#}", $text, $html);
		$html = str_ireplace("{#errurl#}", $link, $html);
		echo $html;
	}

	public static function warning_yidong($text, $link){
		if(empty($text)){
			$text = "发生未知错误";
		}
		$html = file_get_contents(Yii::$app->basePath . "/views/warning/index_yidong.php");
		$html = str_ireplace("{#errmsg#}", $text, $html);
		$html = str_ireplace("{#errurl#}", $link, $html);
		echo $html;
	}
	
}
?>