本文整理汇总了PHP中app\assets\AppAsset::register方法的典型用法代码示例。如果您正苦于以下问题:PHP AppAsset::register方法的具体用法?PHP AppAsset::register怎么用?PHP AppAsset::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\assets\AppAsset
的用法示例。
在下文中一共展示了AppAsset::register方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/* @var $this \yii\web\View */
/* @var $content string */
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
AppAsset::register($this);
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php
echo Yii::$app->language;
?>
">
<head>
<meta charset="<?php
echo Yii::$app->charset;
?>
">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
echo Html::csrfMetaTags();
?>
<title><?php
echo Html::encode($this->title);
?>
</title>
<?php
示例2:
<?php
use app\assets\AppAsset;
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $content string */
if (class_exists('backend\\assets\\AppAsset')) {
backend\assets\AppAsset::register($this);
} else {
app\assets\AppAsset::register($this);
}
dmstr\web\AdminLteAsset::register($this);
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php
echo Yii::$app->language;
?>
">
<head>
<meta charset="<?php
echo Yii::$app->charset;
?>
"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
echo Html::csrfMetaTags();
?>
<title><?php
echo Html::encode($this->title);
?>
示例3:
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ActiveForm;
use app\models\Users;
use app\assets\AppAsset;
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model app\models\LoginForm */
$this->title = 'Class List';
// $this->params['breadcrumbs'][] = $this->title;
$bundle = AppAsset::register($this);
?>
<div class="site-list">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<p>
<?php
echo Html::a('Create Users', ['create'], ['class' => 'btn btn-success']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'StudentNumber', 'FirstName', 'MiddleName', 'LastName', 'ClassSection', ['class' => 'yii\\grid\\ActionColumn']]]);
示例4:
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use app\assets\AppAsset;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\widgets\Alert;
use app\helpers\Bugitor;
AppAsset::register($view);
$view->beginPage();
示例5: registerClientScript
/**
*
*/
public function registerClientScript()
{
$view = $this->getView();
if ($this->language !== null) {
$this->clientOptions['locale'] = $this->language;
AppAsset::register($view)->js[] = $this->localePath . $this->language . '.js';
} else {
AppAsset::register($view);
}
$id = $this->options['id'];
$selector = "jQuery('#{$id}')";
if (strpos($this->template, '{button}') !== false) {
$selector .= ".parent()";
}
$options = !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '';
$js[] = "{$selector}.datetimepicker({$options});";
if (!empty($this->clientEvents)) {
foreach ($this->clientEvents as $event => $handler) {
$js[] = "{$selector}.on('{$event}', {$handler});";
}
}
$view->registerJs(implode("\n", $js));
}
示例6: init
public function init()
{
AppAsset::register($this->getView());
NotifyJsAsset::register($this->getView());
}