當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LuLu::getService方法代碼示例

本文整理匯總了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);
         }
     }
 }
開發者ID:huasxin,項目名稱:lulucms2,代碼行數:28,代碼來源:BaseApplication.php

示例2: init

 public function init()
 {
     parent::init();
     $this->modularityService = LuLu::getService('modularity');
     $this->rbacService = LuLu::getService('rbac');
     $this->taxonomyService = LuLu::getService('taxonomy');
 }
開發者ID:hucongyang,項目名稱:lulucms2,代碼行數:7,代碼來源:BaseView.php

示例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');
 }
開發者ID:phpsong,項目名稱:lulucms2,代碼行數:7,代碼來源:CommonTrait.php

示例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);
 }
開發者ID:qq443140816,項目名稱:lulucms2,代碼行數:9,代碼來源:CommonTrait.php

示例5: getTaxonomy

 public function getTaxonomy()
 {
     return $this->hasOne(LuLu::getService('taxonomy')->getClass("Taxonomy"), ['id' => 'taxonomy_id']);
 }
開發者ID:Nathanyang,項目名稱:lulucms2,代碼行數:4,代碼來源:Content.php

示例6: init

 public function init()
 {
     parent::init();
     $this->modularityService = LuLu::getService('modularityService');
 }
開發者ID:shunzi250,項目名稱:lulucms2,代碼行數:5,代碼來源:BackController.php

示例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 -->
開發者ID:liangdabiao,項目名稱:lulucms2,代碼行數:31,代碼來源:container.php

示例8: getTaxonomyCategories

 public static function getTaxonomyCategories()
 {
     $service = LuLu::getService('taxonomy');
     return $service->getTaxonomyCategories();
 }
開發者ID:qq443140816,項目名稱:lulucms2,代碼行數:5,代碼來源:Common.php

示例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 
    }
開發者ID:phpsong,項目名稱:lulucms2,代碼行數:31,代碼來源:taxonomy.php


注:本文中的source\LuLu::getService方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。