本文整理汇总了PHP中frontend\assets\AppAsset::className方法的典型用法代码示例。如果您正苦于以下问题:PHP AppAsset::className方法的具体用法?PHP AppAsset::className怎么用?PHP AppAsset::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frontend\assets\AppAsset
的用法示例。
在下文中一共展示了AppAsset::className方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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:
<?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
示例3:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Region;
$this->title = Yii::t('app', 'My') . Yii::t('app', 'Address');
$this->params['breadcrumbs'][] = $this->title;
$this->registerCssFile('@web/css/user.css', ['depends' => \frontend\assets\AppAsset::className()]);
?>
<style>
.form button.btn {
width: 108px;
height: 38px;
}
</style>
<div class="my_nala_detail my_address">
<h1><?php
echo $this->title;
?>
</h1>
<div class="detail_r">
<?php
$form = ActiveForm::begin(['id' => '']);
?>
<?php
echo Html::activeHiddenInput($model, 'user_id', ['value' => Yii::$app->user->id]);
?>
<div class="form-bd" id="first-addr-form">
<ul class="form addr-form" id="addr-form">
示例4: 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()]);
示例5: addCss
public static function addCss($view, $cssfile)
{
$view->registerCssFile($cssfile, [AppAsset::className(), 'depends' => 'frontend\\assets\\AppAsset']);
}
示例6:
<?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/*']);
示例7: foreach
<?php
use yii\helpers\Url;
use yii\helpers\Html;
$this->registerJsFile('/js/custom/download.js', ['depends' => \frontend\assets\AppAsset::className()]);
?>
<div class="container" style="padding: 0px 35px">
<div class="row pos bg_preview_post">
<div class="row">
<div class="col-md-12" style="text-align: center">
<h3>Книги22</h3>
</div>
</div>
<div class="row">
<?php
if ($model) {
?>
<?php
foreach ($model as $book) {
?>
<div class="span3">
<?php
echo Html::img('/upload/book-thumbs/' . $book->image, ['width' => '50px']);
?>
<?php
echo $book->image;
示例8:
<?php
/* @var $this yii\web\View */
$this->title = 'Funshop';
$this->registerCssFile('@web/css/index.css', ['depends' => \frontend\assets\AppAsset::className()]);
$this->registerJsFile('@web/js/switchable.js', ['depends' => \frontend\assets\AppAsset::className()]);
?>
<div class="index-banner">
<div class="index-slide" id="index-slide">
<ul>
<li data-img="/images/banner1.jpg">
<a href="#" title=""></a>
</li>
<li data-img="/images/banner2.jpg">
<a href="#" title=""></a>
</li>
<li data-img="/images/banner3.jpg">
<a href="#" title=""></a>
</li>
<li data-img="/images/banner4.jpg">
<a href="#" title=""></a>
</li>
<li data-img="/images/banner1.jpg">
<a href="#" title=""></a>
</li>
<li data-img="/images/banner2.jpg">
<a href="#" title=""></a>
</li>
<li data-img="/images/banner3.jpg">
示例9: function
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use frontend\assets\AppAsset;
$this->registerJsFile('/js/custom/switch-banner.js', ['depends' => AppAsset::className()]);
$this->title = 'Баннеры';
$this->params['breadcrumbs'][] = $this->title;
?>
<div id="content">
<div class="outer">
<div class="inner bg-light lter">
<div id="collapse4" class="body">
<!--Begin Datatables-->
<div class="image-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Загрузить баннер(ы)', ['/banner/default/upload'], ['class' => 'btn btn-success']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['name', ['attribute' => 'name', 'format' => 'html', 'value' => function ($dataProvider) {
示例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">