本文整理汇总了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