1. 程式人生 > 其它 >yii樣式檔案的引入,靜態檔案的引入

yii樣式檔案的引入,靜態檔案的引入

技術標籤:yiiphp

<?php 
	use yii\helpers\Url;
	use yii\widgets\ActiveForm; 
	use backend\assets\AppAsset;
	$this->registerJsFile('/backend/web/log/js/jquery.js', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]);
	$this->registerJsFile('/backend/web/log/js/bootstrap.min.js'
, ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerJsFile('/backend/web/log/js/swiper.min.js', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerJsFile('/backend/web/log/js/main.js'
, ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerJsFile('/backend/web/log/js/wow.min.js', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerJsFile('/backend/web/log/js/mdui.min.js'
, ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerJsFile('/backend/web/log/layer/layer.js', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerCssFile('/backend/web/log/css/bootstrap.css', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerCssFile('/backend/web/log/css/main.css', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerCssFile('/backend/web/log/css/swiper.min.css', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerCssFile('/backend/web/log/css/font-awesome.min.css', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerCssFile('/backend/web/log/css/animate.min.css', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerCssFile('/backend/web/log/css/mdui.min.css', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); $this->registerCssFile('/backend/web/log/layer/mobile/need/layer.css', ['depends' => backend\assets\AppAsset::className(), "position"=> $this::POS_END]); AppAsset::register($this); ?> <?php $this->beginPage() ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php $this->registerCsrfMetaTags() ?> <title>999</title> <?php $this->head() ?> <!-- HTML5 shim 和 Respond.js 是為了讓 IE8 支援 HTML5 元素和媒體查詢(media queries)功能 --> <!-- 警告:通過 file:// 協議(就是直接將 html 頁面拖拽到瀏覽器中)訪問頁面時 Respond.js 不起作用 --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body> <?php $this->beginBody() ?> <div class="log" style="background: url(/backend/web/log/img/login-bg.jpg);background-position: center;background-repeat: no-repeat;background-size: cover;"> <div class="con_log"> <div class="main"> <div class="main_left"> <div class="tit">登陸</div> <form action=""> <div class="form-group"> <input type="text" class="form-control col-md-12" id="inputSuccess1" aria-describedby="helpBlock2" placeholder="使用者名稱"> </div> <div class="form-group"> <input type="password" class="form-control col-md-12" id="inputSuccess2" aria-describedby="helpBlock2" placeholder="密碼"> </div> <div class="form-group form_con"> <input type="text" class="form-control col-md-12" id="inputSuccess3" aria-describedby="helpBlock2" placeholder="驗證碼"> <div class="code">555</div> </div> <div class="form-group"> <input type="submit" class="btn btn-default btn-info" onclick="return fun()" value="登陸"> </div> </form> </div> </div> </div> </div> <?php $this->beginBlock('script') ?> function fun(){ $name=$('#inputSuccess1').val(); $pass=$('#inputSuccess2').val(); $code=$('#inputSuccess3').val(); if($name==''){ layer.msg('請填寫使用者名稱', {icon: 0}); $('#inputSuccess1').focus(); return false; } if($pass==''){ layer.msg('請填寫密碼',{icon:0}); $('#inputSuccess2').focus(); return false; } if($code==''){ layer.msg('請填寫驗證碼',{icon:0}); $('#inputSuccess3').focus(); return false; } } <?php $this->endBlock() ?> <?php $this->registerJs($this->blocks['script'], \yii\web\View::POS_END); ?> <?php $this->endBody() ?> </body> </html> <?php $this->endPage() ?>