本文整理汇总了PHP中source\libs\Resource类的典型用法代码示例。如果您正苦于以下问题:PHP Resource类的具体用法?PHP Resource怎么用?PHP Resource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Resource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setTheme
public function setTheme()
{
$currentTheme = Resource::getHomeTheme();
$moduleId = LuLu::$app->controller->module->id;
$config = ['pathMap' => ['@app/views' => ['@statics/themes/' . $currentTheme . '/views', '@statics/themes/basic/views'], '@source/modules/' . $moduleId . '/home/views' => ['@statics/themes/' . $currentTheme . '/modules/' . $moduleId, '@statics/themes/basic/modules/' . $moduleId]], 'basePath' => '@statics/themes/basic', 'baseUrl' => '@statics/themes/basic'];
$this->theme = new Theme($config);
}
示例2: setTheme
public function setTheme()
{
$currentTheme = Resource::getAdminTheme();
$moduleId = LuLu::$app->controller->module->id;
$config = ['pathMap' => ['@app/views' => ['@statics/admin/' . $currentTheme . '/views'], '@source/modules/' . $moduleId . '/admin/views' => ['@statics/admin/' . $currentTheme . '/modules/' . $moduleId]], 'baseUrl' => '@statics/admin/' . $currentTheme];
$this->theme = new Theme($config);
}
示例3: beginLoopData
public function beginLoopData($dataSource, $item, $appendOptions = [])
{
$options = [];
$options['dataSource'] = $dataSource;
$options['item'] = Resource::getThemePath($item);
return LoopData::begin($options);
}
示例4: showWidget
public function showWidget($name, $params)
{
$currentTheme = Resource::checkHomeThemeFile('/misc/' . $name);
if ($currentTheme) {
$class = '\\statics\\themes\\' . $currentTheme . '\\misc\\' . $name;
echo $class::widget($params);
} else {
echo 'the widget ' . $name . ' does not exist';
}
}
示例5: initDefaultButtons
protected function initDefaultButtons()
{
if (!isset($this->buttons['view'])) {
$this->buttons['view'] = function ($url, $model, $key, $index, $gridView) {
return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/magnifier.png">', $url, ['title' => Yii::t('yii', 'View'), 'data-pjax' => '0']);
};
}
if (!isset($this->buttons['update'])) {
$this->buttons['update'] = function ($url, $model, $key, $index, $gridView) {
return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/pencil.png">', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']);
};
}
if (!isset($this->buttons['delete'])) {
$this->buttons['delete'] = function ($url, $model, $key, $index, $gridView) {
return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/cross.png">', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']);
};
}
}
示例6:
<div class="mod-header-user">
<ul class="pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle mod-bell" data-toggle="dropdown">
<i class="icon icon-bell"></i>
</a>
<ul class="dropdown-menu mod-chat">
<p>没有通知</p>
</ul>
</li>
<li class="dropdown username">
<a href="" class="dropdown-toggle" data-toggle="dropdown">
<img src="<?php echo Resource::getAdminUrl('/images/avatar-mid-img.png')?>" class="img-circle" width="30">
admin888 <span class="caret"></span>
</a>
<ul class="dropdown-menu pull-right mod-user">
<li>
<a href="<?php echo LuLu::getAlias('@web');?>" target="_blank"><i class="icon icon-home"></i>首页</a>
</li>
<li>
<?php echo Html::a('<i class="icon icon-ul"></i>概述',['/site/welcome'],['target'=>'mainFrame'])?>
</li>
<li>
<?php echo Html::a('<i class="icon icon-logout"></i>退出',['/site/logout'],['target'=>'mainFrame'])?>
</li>
示例7: checkHomeThemeFile
public static function checkHomeThemeFile($fileName, $checkDefault = true)
{
$currentTheme = Resource::getHomeTheme();
$path = LuLu::getAlias('statics') . '/themes/' . $currentTheme . $fileName . '.php';
if (!FileHelper::exist($path) && $checkDefault) {
$currentTheme = 'd';
$path = LuLu::getAlias('statics') . '/themes/' . $currentTheme . $fileName . '.php';
} else {
return $currentTheme;
}
if (!FileHelper::exist($path)) {
return false;
}
return $currentTheme;
}
示例8: function
use source\LuLu;
use source\modules\rbac\models\Role;
use source\libs\Resource;
/* @var $this yii\web\View */
/* @var $searchModel app\modules\rbac\models\search\RoleSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$categoryId = LuLu::getGetValue('category');
$this->title = '角色管理';
$this->params['breadcrumbs'][] = $this->title;
$columns = [['attribute' => 'id', 'width' => '120px;'], ['attribute' => 'name', 'width' => '120px;'], ['attribute' => 'description', 'width' => 'auto'], ['class' => 'source\\core\\grid\\ActionColumn', 'template' => '{permission}{update} {delete}', 'buttons' => ['permission' => function ($url, $model) {
return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/key.png">', Url::to(['relation', 'role' => $model['id']]), ['title' => '设置权限']);
}, 'delete' => function ($url, $model) {
if ($model->is_system) {
return '';
}
return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/cross.png">', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']);
}]]];
?>
<?php
$this->toolbars([Html::a('新建', ['create', 'category' => $categoryId], ['class' => 'btn btn-xs btn-primary mod-site-save'])]);
?>
<style>
.ui-tabs .ui-tabs-panel{padding:0px;}
</style>
<div class="da-ex-tabs">
<ul>
<li><a href="#tabs-<?php
echo Role::Category_Member;
?>
示例9:
</div>
<!-- Main Content Wrapper -->
<div id="da-content-wrap" class="clearfix">
<!-- Content Area -->
<div id="da-content-area">
<?php
if (LuLu::getViewParam('defaultLayout') === null) {
?>
<div class="grid_4">
<div class="da-panel">
<div class="da-panel-header">
<span class="da-panel-title">
<img src="<?php
echo Resource::getAdminUrl();
?>
/images/icons/black/16/pencil.png" alt="">
<?php
echo $this->title;
?>
</span>
</div>
<?php
if (($toolbars = LuLu::getViewParam('toolbars')) !== null) {
?>
<div class="da-panel-toolbar top">
<ul>
<?php
示例10: function
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use source\LuLu;
use source\libs\Constants;
use source\core\grid\GridView;
use source\modules\fragment\models\Fragment;
use source\libs\Resource;
/* @var $this source\core\back\BackView */
/* @var $searchModel source\modules\fragment\models\search\FragmentSearch */
/* @var $dataProvider source\core\data\ActiveDataProvider */
$type = LuLu::getGetValue('type');
$this->title = Fragment::getTypeItems($type);
$this->params['breadcrumbs'][] = $this->title;
$this->toolbars([Html::a('新建', ['create', 'type' => $type], ['class' => 'btn btn-xs btn-primary mod-site-save'])]);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'source\\core\\grid\\IdColumn'], 'code', ['attribute' => 'name', 'width' => '250px', 'value' => function ($model, $key, $index, $column) {
$indexUrl = Url::to(['fragment' . $model->type . '-data/index', 'fid' => $model->id, 'type' => $model->type]);
return Html::a($model->name, $indexUrl);
}], ['attribute' => 'description', 'width' => 'auto'], ['class' => 'source\\core\\grid\\ActionColumn', 'width' => '60px', 'template' => '{data-create}{update} {delete}', 'buttons' => ['data-create' => function ($url, $model, $key, $index, $gridView) {
$addUrl = Url::to(['fragment' . $model->type . '-data/create', 'fid' => $model->id, 'type' => $model->type]);
return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/text_signature.png">', $addUrl, ['title' => '添加内容']);
}]]]]);
?>
示例11: init
public function init()
{
parent::init();
$this->libUrl = Resource::getCommonUrl() . '/libs/kindeditor';
}
示例12: registerJsFile
/**
* 向视图中注册默认的js资源
* @param type $jsFile
*/
public static function registerJsFile($jsFile)
{
$jsUrl = Resource::getAdminUrl($jsFile);
LsYii::getView()->registerJsFile($jsUrl, ['depends' => 'yii\\web\\YiiAsset']);
}
示例13:
use source\LuLu;
/* @var $this yii\web\View */
if (!isset($orderBy)) {
$orderBy = 'created_at desc';
}
if (!isset($limit)) {
$limit = 5;
}
if (!isset($item)) {
$item = 'item_pic';
}
$where = [];
if (!isset($isPic)) {
$isPic = true;
}
$moduleId = LuLu::$app->controller->module->id;
if ($moduleId !== 'app-frontend') {
$where = ['content_type' => $moduleId];
}
$query = Content::findQuery($where, $orderBy);
if ($isPic) {
$query->andWhere(['!=', 'thumb', '']);
}
$query->limit($limit);
$contents = $query->all();
?>
<?php
foreach ($contents as $content) {
echo $this->render(Resource::getThemePath('/views/_inc/' . $item), ['content' => $content]);
}
示例14:
<input value="" type="email" name="email" id="email" class="class_input email required" />
<span class="email"></span>
</td>
</tr>
<!-- <tr>
<th height="30" align="right">安装测试数据:</th>
<td>
<input value="Y" type="checkbox" name="testData" style="margin-left: 5px;" id="testData" />
是
</td>
</tr>
<tr>
<th height="30" align="right"> </th>
<td>
<p class="red">全新安装会覆盖旧数据 </p>
</td>
</tr>-->
</table>
<div class="inst_btn_area">
<button type="button" onclick="history.go(-1);return false;" class="button">返 回</button>
<button type="submit" class="button">下一步</button>
</div>
<?php
ActiveForm::end();
?>
</div>
<?php
Resource::jsFile(Resource::getCommonUrl('/js/jquery.min.js'));
Resource::jsFile(Resource::getInstallUrl("/js/jquery.db.validate.js"));
示例15:
<?php
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use source\models\Takonomy;
use source\libs\Resource;
/* @var $this \yii\web\View */
/* @var $content string */
Resource::registerCommon('/libs/bootstrap/3.0.2/css/bootstrap.css');
Resource::registerCommon('/js/common.js');
Resource::registerAdmin('/css/site.css');
$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