本文整理汇总了PHP中source\LuLu::getService方法的典型用法代码示例。如果您正苦于以下问题:PHP LuLu::getService方法的具体用法?PHP LuLu::getService怎么用?PHP LuLu::getService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source\LuLu
的用法示例。
在下文中一共展示了LuLu::getService方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadActiveModules
public function loadActiveModules($isAdmin)
{
$moduleManager = LuLu::getService('modularityService');
$this->activeModules = $moduleManager->getActiveModules($isAdmin);
$module = $isAdmin ? 'AdminModule' : 'HomeModule';
foreach ($this->activeModules as $m)
{
$moduleId = $m['id'];
$moduleDir = $m['dir'];
$ModuleClassName = $m['dir_class'];
$this->setModule($moduleId, [
'class' => 'source\modules\\' . $moduleDir . '\\' . $module
]);
$serviceFile= LuLu::getAlias('@source').'\modules\\' .$moduleDir.'\\'.$ModuleClassName.'Service.php';
if(FileHelper::exist($serviceFile))
{
$serviceClass = 'source\modules\\' .$moduleDir.'\\'.$ModuleClassName.'Service.php';
$serviceInstance = new $serviceClass();
$this->set($serviceInstance->getServiceId(), $serviceInstance);
}
}
}
示例2: init
public function init()
{
parent::init();
$this->modularityService = LuLu::getService('modularity');
$this->rbacService = LuLu::getService('rbac');
$this->taxonomyService = LuLu::getService('taxonomy');
}
示例3: initService
public function initService()
{
$this->modularityService = LuLu::getService('modularity');
$this->rbacService = LuLu::getService('rbac');
$this->taxonomyService = LuLu::getService('taxonomy');
$this->menuService = LuLu::getService('menu');
}
示例4: __get
public function __get($name)
{
$dot = strpos($name, 'Service');
if ($dot > 0) {
$serviceName = substr($name, 0, $dot);
return LuLu::getService($serviceName);
}
return parent::__get($name);
}
示例5: getTaxonomy
public function getTaxonomy()
{
return $this->hasOne(LuLu::getService('taxonomy')->getClass("Taxonomy"), ['id' => 'taxonomy_id']);
}
示例6: init
public function init()
{
parent::init();
$this->modularityService = LuLu::getService('modularityService');
}
示例7:
<?php
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use source\models\Taxonomy;
use source\libs\Resource;
use source\LuLu;
use yii\helpers\Url;
use source\modules\menu\models\Menu;
/* @var $this \yii\web\View */
/* @var $content string */
$rbacService = LuLu::getService('rbac');
?>
<?php
$this->beginPage();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Viewport metatags -->
<meta name="HandheldFriendly" content="true" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- iOS webapp metatags -->
示例8: getTaxonomyCategories
public static function getTaxonomyCategories()
{
$service = LuLu::getService('taxonomy');
return $service->getTaxonomyCategories();
}
示例9: foreach
<?php
use yii\web\View;
use yii\helpers\Html;
use yii\helpers\Url;
use source\libs\Resource;
use source\models\Content;
use source\models\Taxonomy;
use source\LuLu;
/* @var $this yii\web\View */
$moduleId = LuLu::$app->controller->module->id;
$taxonomies = LuLu::getService('taxonomy')->getTaxonomiesAsTree($this->getConfigValue($moduleId . '_taxonomy'));
if (!empty($taxonomies)) {
?>
<div class="sidebar-block">
<h3 class="catListTitle">分类</h3>
<div>
<ul>
<li><?php
echo Html::a('所有', ['/' . $moduleId . '/default/list']);
?>
</li>
<?php
foreach ($taxonomies as $taxonomy) {
?>
<li><?php
echo Html::a($taxonomy['name'], ['/' . $moduleId . '/default/list', 'taxonomy' => $taxonomy['id']]);
?>
</li>
<?php
}