本文整理匯總了PHP中frontend\assets\AppAsset類的典型用法代碼示例。如果您正苦於以下問題:PHP AppAsset類的具體用法?PHP AppAsset怎麽用?PHP AppAsset使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了AppAsset類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public function init()
{
if (!\Yii::$app->user->isGuest) {
if (Collection::isFav(['obj_type' => $this->object['obj_type'], 'obj_id' => $this->object['obj_id']])) {
$this->status = 1;
$this->label = "已收藏";
}
}
$assets = \Yii::$app->assetManager->publish('@app/modules/favorite/exts/assets/', ['forceCopy' => true]);
$this->getView()->registerJsFile($assets['1'] . '/favorite.js', ['depends' => [AppAsset::className()]]);
}
示例2: init
public function init()
{
parent::init();
$geo = new \jisoft\sypexgeo\Sypexgeo();
$res = $geo->get();
$request = \Yii::$app->request->getQueryParams();
$category = Category::find()->byUrl(ArrayHelper::getValue($request, Category::URL_PARAM_CATEGORY))->one();
$subcategory = Category::find()->byUrl(ArrayHelper::getValue($request, Category::URL_PARAM_SUBCATEGORY))->one();
$rubric = Category::find()->byUrl(ArrayHelper::getValue($request, Category::URL_PARAM_RUBRIC))->one();
$this->view->params = ['bundle' => AppAsset::register($this->view), 'categories' => Category::getMain(), 'countryEn' => $res['country']['name_en'], 'category' => $category, 'subcategory' => $subcategory, 'rubric' => $rubric];
}
示例3:
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use frontend\assets\AppAsset;
$this->title = '【騎行中國-二手自行車專賣網】';
$this->params['bodyClass'] = 'home';
$bundle = AppAsset::register($this);
AppAsset::addCss($this, $bundle->baseUrl . '/vender/owlcarousel/assets/owl.carousel.css');
AppAsset::addScript($this, $bundle->baseUrl . '/vender/owlcarousel/owl.carousel.min.js');
?>
<section class="section-banner">
<h2 class="slogan"><img src="<?php
echo $bundle->baseUrl;
?>
/image/banner-text1.png" /></h2>
<div class="search-box" >
<input type="text" class="search-input" placeholder="請輸入你想要的品牌,車型" />
<button type="button" class="search-btn" >搜索</button>
</div>
</section><!-- /.section-banner -->
<section class="section-portfolio">
<div class="section-title">
<h2>哪一款單車才是你的最愛?</h2>
<span></span>
</div>
<?php
echo \widgets\PortfolioWidget::widget(['items' => [['link' => '', 'caption' => '通勤自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_common.jpg'], ['link' => '', 'caption' => '山地自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_mountain_1.jpg'], ['link' => '', 'caption' => '公路自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_road_1.jpg'], ['link' => '', 'caption' => '折疊自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_folding.jpg'], ['link' => '', 'caption' => '女式自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_girl.jpg'], ['link' => '', 'caption' => '兒童自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_children.jpg'], ['link' => '', 'caption' => '電動自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_electric.jpg'], ['link' => '', 'caption' => '死飛自行車', 'image' => $bundle->baseUrl . '/image/portfolio/bike_fix_gear.jpg']]]);
?>
示例4:
<?php
/**
* Created by PhpStorm.
* User: dev
* Date: 03.03.15
* Time: 10:35
* @var $event \common\models\Event
* @var $this \yii\web\View
*/
use common\models\User;
use yii\helpers\Url;
$this->registerJsFile('/js/event-view.js', ['depends' => \frontend\assets\YMapAsset::className()]);
$this->registerCssFile('/css/event-view.css', ['depends' => \frontend\assets\AppAsset::className()]);
$date = \common\helpers\Time::toDateTime($event->begin);
$this->title = $event->name;
?>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-6 col-lg-5">
<div class="panel panel-default">
<div class="event-buttons">
<?php
if ($event->isMy()) {
?>
<a href="<?php
echo Url::to(['event/edit', 'id' => $event->id]);
?>
" class="event-favorite"><i
示例5:
<?php
use frontend\assets\AppAsset;
AppAsset::register($this);
AppAsset::addCss($this, '@web/css/life.css');
echo $this->render('/layouts/tabbar', ['cur' => 'life']);
?>
<div class="top_banner"></div>
<div class="life_wp">
<div class="life_bg layout1280">
<?php
?>
<div class="sidermeun">
<h2>橙鮮生活</h2>
<ul>
<?php
use common\widgets\FVariable;
foreach ($modelList as $k => $v) {
$class = '';
if ($id == $v->categoryId) {
$class = 'cur';
}
echo ' <li><a class="' . $class . '" href="' . Yii::$app->urlManager->createUrl([FVariable::$lifeIndex_url, 'id' => $v->categoryId]) . '">' . $v->title . '</a></li>';
}
?>
</ul>
</div>
<div class="ly-right">
<h2 class="fm ft26"><?php
echo $model->title;
示例6:
<?php
use frontend\assets\AppAsset;
AppAsset::register($this);
AppAsset::addCss($this, '@web/css/orc.css');
AppAsset::addScript($this, '@web/js/orc.js');
echo $this->render('/layouts/tabbar', ['cur' => 'orc']);
?>
<div class="swiper-container banner_max" id="banner_max">
<div class="swiper-wrapper">
<!-- banner1 -->
<div class="swiper-slide">
<div class="banner1_wp">
<img src="/images/com/arr.png" class="img_arr pt-page-moveIconUp">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="layout">
<div class="tit_txt ani" swiper-animate-effect="fadeInLeft" swiper-animate-duration="1s" swiper-animate-delay="0"></div>
<ul>
<li class="ani p1" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0"></li>
<li class="ani p2" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.1s"></li>
<li class="ani p3" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.2s"></li>
<li class="ani p4" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s"></li>
<li class="ani p5" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.4s"></li>
<li class="ani p6" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"></li>
<li class="ani p7" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.6s"></li>
<li class="ani p8" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.7s"></li>
</ul>
<div class="banner1_img"></div>
</div>
</div>
示例7: count
d. Вернуть фирму, имеющую максимальное кол-во телефонов.
</div>
<div class="row">
<div class="col-lg-3">
<?php
echo GridView::widget(['dataProvider' => $dataProvider5, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'Name', 'pPhone']]);
?>
</div>
</div>
<div class="row">
SELECT *
FROM `Firms`
LEFT JOIN `Phones` ON `id` = `FirmID`
GROUP BY `id`
HAVING count( `phone_id` ) = (SELECT MAX( `cpid` ) AS `mcpid`
FROM (
SELECT count( `FirmID` ) AS `cpid`
FROM `Firms`
LEFT JOIN `Phones` ON `id` = `FirmID`
GROUP BY `FirmID`
) AS cphone)
</div>
</div>
</div>
</div>
</div>
<?php
$this->registerJsFile('/js/tab.js', ['depends' => AppAsset::className()]);
示例8:
<?php
use frontend\assets\AppAsset;
use common\widgets\GlobalArray;
AppAsset::register($this);
AppAsset::addScript($this, "/js/jquery.imagezoom.min.js");
$this->beginBlock('test');
?>
$(document).ready(function(){
$(".bigimg-jqzoom").imagezoom();
});
<?php
$this->endBlock();
$this->registerJs($this->blocks['test'], \yii\web\View::POS_END);
?>
<div class="teadetails" id="teadetails">
<div class="section">
<div class="teaDet container">
<!-- <p class="teaDet-share">喜大奔普:<a href=""><img src="/img/fx2.png" /></a><a href=""><img src="/img/fx1.png" /></a><a href=""><img src="/img/u109.png" /></a><a href=""><img src="/img/fx3.png" /></a><a href=""><img src="/img/fx5.png" /></a></p>-->
<div class="teaDet-con cl">
<div class="teaDet-con-left">
<div class="bigimg"><img src="/img/index_11.png" class="img-responsive bigimg-jqzoom" rel="/img/index_11.png" /></div>
<div class="smallimg cl">
<div class="smallimg-div">
<ul class="smallimg-ul">
<?php
$active = "active";
foreach ($MaterialList as $k => $v) {
示例9:
<h3>慕課網</h3>
<span>慕課網,隻學有用的</span>
<img src="imgs/pic1.jpg">
<img src="imgs/pic2.jpg">
<img src="imgs/pic3.jpg">
<img src="imgs/pic4.jpg">
</div>
</div>
<input type="date">時間
<a target=blank href=tencent://message/?uin=203674576&Site=pretty&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=1:203674576:6 alt="顯示的字符"></a>
<img style="CURSOR: pointer" onclick="javascript:window.open('http://b.qq.com/webc.htm?new=0&sid=820168613&o=qfy.link&q=7', '_blank', 'height=502, width=644,toolbar=no,scrollbars=no,menubar=no,status=no');" border="0" SRC=http://wpa.qq.com/pa?p=1:820168613:1 alt="廊橋遺夢">
<script>
<?php
AppAsset::addScript($this, 'js/velocity.min.js');
AppAsset::addScript($this, 'js/velocity.ui.min.js');
AppAsset::addScript($this, 'js/photo.js');
?>
// public $js = [
// 'js/velocity.min.js',
// 'js/velocity.ui.min.js',
// 'js/photo.js',
// ];
//隻在該視圖中使用非全局的jui
</script>
<script type="text/javascript">
(function(){
var p = {
url:location.href, /*獲取URL,可加上來自分享到QQ標識,方便統計*/
desc:'pretty', /*分享理由(風格應模擬用戶對話),支持多分享語隨機展現(使用|分隔)*/
title:'pretty', /*分享標題(可選)*/
示例10: addScript
public static function addScript($view, $jsfile)
{
$view->registerJsFile($jsfile, [AppAsset::className(), 'depends' => 'frontend\\assets\\AppAsset']);
}
示例11:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\tinymce\TinyMce;
use yii\helpers\Url;
use frontend\assets\AppAsset;
$this->registerJsFile('/js/custom/tiny.js', ['depends' => AppAsset::className()]);
?>
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($model, 'image')->textInput(['maxlength' => 255]);
?>
<?php
if ($model->image && $model->image != '') {
?>
<img src="<?php
echo $model->image;
?>
" height="200px">
示例12:
<?php
use frontend\assets\AppAsset;
AppAsset::register($this);
AppAsset::addScript($this, '@web/js/jquery.fullPage.min.js');
AppAsset::addScript($this, '@web/js/pageContain.js');
?>
<div class="pageContain" id="pageContain">
<div class="section container">
<p class="page-txt">景陽青茶園地處魯東南風景秀麗的磴山腳下,茶園北依世界五大太陽崇拜起源地日照天台山,西鄰黃海九寨溝,原生態環境保護極好,公司下設栗香茶葉專業合作社、茶廠、茶業研究所、網絡營銷中心,是山東省較早導入CIS戰略的現代化茶葉生產、加工、銷售和茶文化傳播企業,是山東省茶葉生產加工技術研究推廣中心和山東省茶葉工程技術研究中心實驗點,現有高級農藝師2名</p>
<p class="page-img"><img src="/img/2.jpg" class="img-responsive" /></p>
</div>
<div class="section container">
<p class="page-txt">景陽青茶園地處魯東南風景秀麗的磴山腳下,茶園北依世界五大太陽崇拜起源地日照天台山,西鄰黃海九寨溝,原生態環境保護極好,公司下設栗香茶葉專業合作社、茶廠、茶業研究所、網絡營銷中心,是山東省較早導入CIS戰略的現代化茶葉生產、加工、銷售和茶文化傳播企業,是山東省茶葉生產加工技術研究推廣中心和山東省茶葉工程技術研究中心實驗點,現有高級農藝師2名</p>
<p class="page-img"><img src="/img/1.jpg" class="img-responsive" /></p>
</div>
<div class="section container">
<p class="page-txt">景陽青茶園地處魯東南風景秀麗的磴山腳下,茶園北依世界五大太陽崇拜起源地日照天台山,西鄰黃海九寨溝,原生態環境保護極好,公司下設栗香茶葉專業合作社、茶廠、茶業研究所、網絡營銷中心,是山東省較早導入CIS戰略的現代化茶葉生產、加工、銷售和茶文化傳播企業,是山東省茶葉生產加工技術研究推廣中心和山東省茶葉工程技術研究中心實驗點,現有高級農藝師2名</p>
<p class="page-img"><img src="/img/3.jpg" class="img-responsive" /></p>
</div>
<div class="section container">
示例13:
<?php
use frontend\assets\AppAsset;
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use common\widgets\GlobalArray;
AppAsset::register($this);
AppAsset::addCss($this, '/css/font-awesome.css');
?>
<div class="evaluate">
<div class="evaluate-head">
<div>商品信息</div>
<div>購買時間</div>
<div>數量</div>
</div>
<div class="evaluate-con">
<?php
$productDetails = \frontend\models\OrderDetail::findByOrderDetail($details->id);
$order = \frontend\models\Order::findOne($details->id);
$orderDetail = $order->getProductDetail()->all();
foreach ($orderDetail as $detk => $detv) {
$product = \frontend\models\OrderDetail::findOne($detv['id']);
$product = $product->getProduct()->one();
?>
<div>
<div class="eva-img"><img src="<?php
echo GlobalArray::$imgUrlArray['0'] . $product['productLogo'];
?>
" /><?php
echo $product['productName'];
示例14:
<?php
/**
* Created by PhpStorm.
* User: albert
* Date: 05.03.15
* Time: 22:36
* @var $this \yii\web\View
* @var $user \common\models\User
* @var $avatar \frontend\models\AvatarForm
*/
\frontend\assets\JCrop::register($this);
$appAssetName = \frontend\assets\AppAsset::className();
$this->registerJsFile('/js/avatar-change.js', ['depends' => [$appAssetName]]);
$this->registerCssFile('/css/avatar-change.css', ['depends' => [$appAssetName]]);
$form = \yii\bootstrap\ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data', 'enableAjaxValidation' => true]]);
echo $form->field($avatar, 'x', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'y', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'x2', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'y2', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'w', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'h', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'oH', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'oW', ['template' => '{input}'])->hiddenInput();
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div id="avatar-change-container" class="panel-body">
<?php
echo $form->field($avatar, 'img', ['template' => "{input}\n{hint}\n{error}"])->fileInput(['class' => 'hidden', 'accept' => 'image/*']);
示例15:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use frontend\assets\AppAsset;
AppAsset::register($this);
AppAsset::addScript($this, '/js/area.js');
?>
<div class="vipcon">
<div class="vipcon-left">
<?php
$index_vip = "vcenter";
echo $this->render(\common\widgets\FVariable::$layoutVipmenu_view, ['index_vip' => $index_vip]);
?>
</div>
<div class="vipcon-right">
<div class="addaddress">
<div class="addaddree-head">
<span>添加配送地址</span>
<a href="<?php
echo \common\widgets\FVariable::$userVipcenter_url;
?>
" class="addaddree-head-a">返回上一級</a>
</div>
<div class="addaddress-con">
<?php
$form = ActiveForm::begin(['id' => 'AddAddressForm', 'options' => ['name' => 'AddAddressForm']]);
?>
<?php