本文整理汇总了PHP中Asset::publish方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset::publish方法的具体用法?PHP Asset::publish怎么用?PHP Asset::publish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset::publish方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerJS
public static function registerJS($includeJS)
{
if (is_string($includeJS)) {
$includeJS = [$includeJS];
}
if (!empty($includeJS)) {
foreach ($includeJS as $js) {
$jspath = realpath(Asset::resolveAlias($js));
if (is_dir($jspath)) {
$path = Asset::publish($jspath);
$files = glob($jspath . "/*");
foreach ($files as $p) {
if (pathinfo($p, PATHINFO_EXTENSION) != "js") {
continue;
}
$p = str_replace($jspath, '', realpath($p));
Yii::app()->clientScript->registerScriptFile($path . str_replace("\\", "/", $p), CClientScript::POS_END);
}
} else {
if (is_file($jspath)) {
Yii::app()->clientScript->registerScriptFile(Asset::publish($jspath), CClientScript::POS_END);
}
}
}
}
}
示例2: renderScript
/**
* @return array Fungsi ini akan melakukan render script dan me-return array $html.
*/
public function renderScript()
{
$includeJS = $this->includeJS();
$html = [];
if (count($includeJS) > 0) {
foreach ($includeJS as $js) {
$class = get_class($this);
$html[] = Asset::publish(Yii::getPathOfAlias("application.components.ui.Widgets.{$class}") . '/' . $js);
}
}
return $html;
}
示例3: listTemplates
public static function listTemplates()
{
$dir = Yii::getPathOfAlias('application.components.codegen.templates');
$glob = array_slice(scandir($dir), 2);
$list = [];
foreach ($glob as $k => $l) {
$t = [];
$t['name'] = $l;
$t['icon'] = Asset::publish($dir . "/" . $l . "/icon.png");
$list[] = $t;
}
return $list;
}
示例4:
<i style="float:left;margin:8px 3px 0px -10px;" class="fa fa-fw <?php
echo $icon;
?>
"></i>
<?php
}
?>
<?php
echo $title;
?>
</div>
<div ui-content>
<div oc-lazy-load="{name: 'ng-context-menu', files: [
'<?php
echo Asset::publish('application.components.ui.MenuTree.ng-contextmenu.js', true);
?>
'
]}">
<div oc-lazy-load="{name: 'ui.tree', files: ['<?php
echo $this->staticUrl('/js/lib/angular.ui.tree.js');
?>
']}">
<script type="text/ng-template"
id="<?php
echo $class;
?>
MenuTreeLoop"><?php
include 'menu_layout.php';
?>
</script>
示例5: renderAdditionalJS
/**
* @param boolean $isAjax
*/
public function renderAdditionalJS($isAjax = false)
{
$reflector = new ReflectionClass($this->model);
$formDir = dirname($reflector->getFileName()) . DIRECTORY_SEPARATOR;
if (count(@$this->form['includeJS']) > 0) {
foreach ($this->form['includeJS'] as $script) {
$src = $formDir . $script;
if (is_file($src)) {
$scriptUrl = Asset::publish($src);
if ($isAjax) {
echo '
<script type="text/javascript" src="' . $scriptUrl . '"></script>';
} else {
Yii::app()->clientScript->registerScriptFile($scriptUrl, CClientScript::POS_END);
}
}
}
}
}
示例6: registerCSS
public static function registerCSS($includeCSS)
{
if (is_string($includeCSS)) {
$includeCSS = [$includeCSS];
}
if (!empty($includeCSS)) {
foreach ($includeCSS as $css) {
$path = Asset::resolveAlias($css);
if (is_file($path . ".css")) {
$file = $path . ".css";
if (strpos($file, Setting::getRootPath()) === 0) {
$file = substr($file, strlen(Setting::getRootPath()));
$file = Yii::app()->baseUrl . $file;
}
Yii::app()->clientScript->registerCssFile($file);
continue;
}
$csspath = realpath($path);
if (is_dir($csspath)) {
$path = Asset::publish($csspath);
$files = glob($csspath . "/*");
foreach ($files as $p) {
if (pathinfo($p, PATHINFO_EXTENSION) != "css") {
continue;
}
$p = str_replace($csspath, '', realpath($p));
Yii::app()->clientScript->registerCssFile($path . str_replace("\\", "/", $p));
}
} else {
if (is_file($csspath)) {
Yii::app()->clientScript->registerCssFile(Asset::publish($csspath));
}
}
}
}
}
示例7: renderScript
/**
* @return array Fungsi ini akan melakukan render script dan me-return array $html.
*/
public function renderScript()
{
$includeJS = $this->includeJS();
$html = [];
if (count($includeJS) > 0) {
foreach ($includeJS as $js) {
$class = get_class($this);
$jspath = realpath(Yii::getPathOfAlias("application.components.ui.FormFields.{$class}") . '/' . $js);
if (is_dir($jspath)) {
$path = Asset::publish($jspath);
$files = glob($jspath . "/*");
foreach ($files as $p) {
$p = str_replace($jspath, '', realpath($p));
$html[] = $path . str_replace("\\", "/", $p);
}
} else {
$html[] = Asset::publish($jspath);
}
}
}
$includeCSS = $this->includeCSS();
if (count($includeCSS) > 0) {
foreach ($includeCSS as $css) {
$class = get_class($this);
$html[] = Asset::publish(Yii::getPathOfAlias("application.components.ui.FormFields.{$class}") . '/' . $css);
}
}
return $html;
}
示例8:
</div>
</div>
</div>
</div>
<div ui-layout-container style="padding:0px 0px 0px 1px;overflow:hidden;border:0px;">
<div class="loading invisible">
<span>
<b>
<i class="fa fa-refresh fa-spin"></i> Loading {{active.name}}...
</b>
</span>
</div>
<iframe src="<?php
echo $this->createUrl('empty');
?>
" scrolling="no"
seamless="seamless" name="iframe" frameborder="0" class="invisible"
style="width:100%;height:100%;overflow:hidden;display:block;">
</iframe>
</div>
</div>
</div>
<script>var actionFormList = <?php
echo $this->actionFormList();
?>
;</script>
<script src="<?php
echo Asset::publish('application.modules.dev.views.forms.index.js', true);
?>
"></script>