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


PHP LuLu::getAlias方法代碼示例

本文整理匯總了PHP中source\LuLu::getAlias方法的典型用法代碼示例。如果您正苦於以下問題:PHP LuLu::getAlias方法的具體用法?PHP LuLu::getAlias怎麽用?PHP LuLu::getAlias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在source\LuLu的用法示例。


在下文中一共展示了LuLu::getAlias方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getThemeUrl

 public static function getThemeUrl($url = null)
 {
     $currentTheme = LuLu::getAppParam('homeTheme');
     $ret = LuLu::getAlias('@web/static/themes/' . $currentTheme);
     if ($url != null) {
         return $ret . $url;
     }
     return $ret;
 }
開發者ID:merlinxie,項目名稱:lulublog,代碼行數:9,代碼來源:Resource.php

示例3: loadAllModules

 private function loadAllModules()
 {
     if ($this->allModules !== null) {
         return $this->allModules;
     }
     $this->allModules = [];
     $moduleRootPath = LuLu::getAlias('@source') . '/modules';
     if ($moduleRootDir = @dir($moduleRootPath)) {
         while (($moduleFolder = $moduleRootDir->read()) !== false) {
             $modulePath = $moduleRootPath . '/' . $moduleFolder;
             if (preg_match('|^\\.+$|', $moduleFolder) || !is_dir($modulePath)) {
                 continue;
             }
             if ($moduleDir = @dir($modulePath)) {
                 $moduleClassName = ucwords($moduleFolder);
                 $class = null;
                 $instance = null;
                 $has_admin = false;
                 $has_home = false;
                 while (($item = $moduleDir->read()) !== false) {
                     $itemPath = $moduleRootPath . '/' . $moduleFolder . '/' . $item;
                     if (preg_match('|^\\.+$|', $item) || is_dir($itemPath)) {
                         continue;
                     }
                     if ($item === $moduleClassName . 'Info.php') {
                         $class = 'source\\modules\\' . $moduleFolder . '\\' . $moduleClassName . 'Info';
                     }
                     if ($item === 'AdminModule.php') {
                         $has_admin = true;
                     }
                     if ($item === 'HomeModule.php') {
                         $has_home = true;
                     }
                 }
                 if ($class !== null) {
                     try {
                         // $moduleObj = LuLu::createObject($class);
                         $instance = new $class();
                         if (empty($instance->id)) {
                             $instance->id = $moduleFolder;
                         }
                         if (empty($instance->name)) {
                             $instance->name = $moduleFolder;
                         }
                     } catch (Exception $e) {
                         // $instance=$e;
                     }
                 }
                 if ($instance !== null) {
                     $this->allModules[$instance->id] = ['id' => $instance->id, 'dir' => $moduleFolder, 'dir_class' => $moduleClassName, 'class' => $class, 'instance' => $instance, 'can_install' => true, 'can_uninstall' => true, 'has_admin' => $has_admin, 'has_home' => $has_home, 'can_active_admin' => false, 'can_active_home' => false];
                 }
             }
         }
     }
     return $this->allModules;
 }
開發者ID:snowbai,項目名稱:lulucms2,代碼行數:56,代碼來源:ModularitySerivce.php

示例4: actionIndex

 public function actionIndex()
 {
     $model = new CacheForm();
     if (LuLu::$app->request->isPost && $model->load(LuLu::$app->request->post())) {
         if ($model->cache) {
             LuLu::flushCache();
             LuLu::$app->schemaCache->flush();
         }
         if ($model->asset) {
             $assetDir = LuLu::getAlias('@statics/assets');
             FileHelper::removeDirectoryContent($assetDir);
         }
         return $this->redirect(['index']);
     }
     return $this->render('index', ['model' => $model]);
 }
開發者ID:hucongyang,項目名稱:lulucms2,代碼行數:16,代碼來源:CacheController.php

示例5: loadAllModules

 private function loadAllModules()
 {
     $ret = [];
     $moduleRootPath = LuLu::getAlias('@source') . '/modules';
     if ($moduleRootDir = @dir($moduleRootPath)) {
         while (($moduleFile = $moduleRootDir->read()) !== false) {
             $modulePath = $moduleRootPath . '/' . $moduleFile;
             if (preg_match('|^\\.+$|', $moduleFile) || !is_dir($modulePath)) {
                 continue;
             }
             if ($moduleDir = @dir($modulePath)) {
                 $moduleInfo = str_replace(' ', '', ucwords(implode(' ', explode('-', $moduleFile))));
                 $class = null;
                 $instance = null;
                 $can_active_admin = null;
                 $can_active_home = null;
                 while (($item = $moduleDir->read()) !== false) {
                     $itemPath = $moduleRootPath . '/' . $moduleFile . '/' . $item;
                     if (preg_match('|^\\.+$|', $item) || is_dir($itemPath)) {
                         continue;
                     }
                     if ($item === $moduleInfo . 'Module.php') {
                         $class = 'source\\modules\\' . $moduleFile . '\\' . $moduleInfo . 'Module';
                     }
                 }
                 if ($class !== null) {
                     try {
                         // $moduleObj = LuLu::createObject($class);
                         $instance = new $class();
                         if (empty($instance->name)) {
                             $instance->name = $moduleFile;
                         }
                     } catch (Exception $e) {
                         // $instance=$e;
                     }
                 }
                 $ret[$moduleFile] = ['id' => $moduleFile, 'class' => $class, 'instance' => $instance, 'can_install' => true, 'can_uninstall' => true, 'can_active_admin' => false, 'can_active_home' => false];
             }
         }
     }
     return $ret;
 }
開發者ID:merlinxie,項目名稱:lulublog,代碼行數:42,代碼來源:ModuleManager.php

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

示例7:

?>
/images/pp.jpg" alt="" />
                            </div>
                            <div id="da-user-info">
                                <?php 
echo LuLu::$app->user->identity->username;
?>
                            </div>
                            <ul class="da-header-dropdown">
                                <li class="da-dropdown-caret">
                                    <span class="caret-outer"></span>
                                    <span class="caret-inner"></span>
                                </li>
                                <li class="da-dropdown-divider"></li>
                                <li><a href="<?php 
echo LuLu::getAlias('@web') . '/index.php';
?>
" target="_blank">站點首頁</a></li>
                            </ul>
                            
                        </div>
                        <div id="da-header-button-container">
                            <ul>
                                <li class="da-header-button logout">
                                    <?php 
echo Html::a('退出', ['/site/logout']);
?>
                                </li>
                            </ul>
                        </div>
                    </div>
開發者ID:shunzi250,項目名稱:lulucms2,代碼行數:31,代碼來源:container.php

示例8: reloadAdmin

 public function reloadAdmin()
 {
     $url = LuLu::getAlias('@web') . '/admin.php';
     exit('<script>top.location.href="' . $url . '"</script>');
 }
開發者ID:shunzi250,項目名稱:lulucms2,代碼行數:5,代碼來源:BackController.php

示例9:

<?php $this->beginPage() ?>
<!DOCTYPE HTML>
<html>

<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="blank" />
<meta name="format-detection" content="telephone=no" />
<title>登錄——LuLu CMS 管理中心</title>

<base href="<?php echo LuLu::getAlias('@web');?>" />
<?php Resource::registerAdmin('/css/bootstrap.css?v=20150409');?>
    
    <?php Resource::registerAdmin('/css/icon.css?v=20150409');?>
    <?php Resource::registerAdmin('/css/login.css?v=20150409');?>
    
<script type="text/javascript">
    var G_INDEX_SCRIPT = "?/";
    var G_BASE_URL = "";
    var G_USER_ID = "1";
    var G_POST_HASH = "";
</script>
    <?php Resource::registerAdmin('/css/common.css?v=20150409');?>

    <?php Resource::registerAdmin('/js/jquery.2.js?v=20150409');?>
    <?php Resource::registerAdmin('/js/aws_admin.js?v=20150409');?>
開發者ID:huasxin,項目名稱:lulucms2,代碼行數:30,代碼來源:login.php

示例10:

?>
<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="blank" />
    <meta name="format-detection" content="telephone=no" />
    <title>登錄——LuLu CMS 管理中心</title>

    <base href="<?php 
echo LuLu::getAlias('@web');
?>
" />
    <?php 
Resource::registerAdmin('/css/bootstrap.css?v=20150409');
?>

    <?php 
Resource::registerAdmin('/css/icon.css?v=20150409');
?>
    <?php 
Resource::registerAdmin('/css/login.css?v=20150409');
?>

    <script type="text/javascript">
        var G_INDEX_SCRIPT = "?/";
開發者ID:ruzuojun,項目名稱:lulucms2,代碼行數:31,代碼來源:CopyOflogin.php

示例11: getThemeUrl

 public static function getThemeUrl($url = null)
 {
     $currentTheme = self::getHomeTheme();
     $ret = LuLu::getAlias('@web/statics/themes/' . $currentTheme);
     if ($url != null) {
         return $ret . $url;
     }
     return $ret;
 }
開發者ID:hucongyang,項目名稱:lulucms2,代碼行數:9,代碼來源:Resource.php

示例12:

                        </li>
                        -->
                    </ul>
                </div>


                <div id="info">
                    <ul>
                        <li>您好,<?php echo LuLu::$app->user->identity->username?>
                        </li>
                        <li>
                            <?php echo Html::a('退出',['/site/logout'])?>
                        </li>

                        <li>
                            <a href="<?php echo LuLu::getAlias('@web').'/index.php';?>" target="_blank">站點首頁</a>
                        </li>

                    </ul>
                </div>
            </td>
        </tr>
        <tr>
            <td valign="top" id="leftContent">
                <div id="leftMenu">
                    <ul class="mod-bar" id="home">
                        <li>
                            <?php echo Html::a('<span>歡迎中心</span>',['/site/welcome'],['class'=>'active','target'=>'mainFrame'])?>
                        </li>
                    </ul>
開發者ID:huasxin,項目名稱:lulucms2,代碼行數:30,代碼來源:container.php

示例13:

                <li style="float:right;">
                    <div class="toggle-search"><i class="fa fa-search"></i></div>
                    <div class="search-expand" style="display: none;"><div class="search-expand-inner"><form method="get" class="searchform themeform"  action="/"><div> <input type="ext" class="search" name="s" onblur="if(this.value=='')this.value='search...';" onfocus="if(this.value=='search...')this.value='';" value="search..."></div></form></div></div>
                </li>
            </ul>
        </div>
        
    </header>
   
   <section class="container" style="padding-top: 10px;height:100%;">
    <?php echo $content;?>
   </section>
   
    <footer class="footer">
        <div class="footer-inner">
            <div class="copyright pull-left">
                <a href="<?php echo LuLu::getAlias('@web')?>" >LuLu CMS</a> 保留一切權利 ·   © 2011-2015
            </div>
            <div class="trackcode pull-right">
              
                
            </div>
        </div>
    </footer>

      統計代碼  <?php echo $this->getConfigValue('sys_stat');?>
<?php $this->endBody() ?>
</body>
</html>

<?php $this->endPage() ?>
開發者ID:huasxin,項目名稱:lulucms2,代碼行數:31,代碼來源:main.php

示例14: getInstallUrl

 public static function getInstallUrl($url = null)
 {
     $ret = LuLu::getAlias('@web/statics/install');
     if ($url != null) {
         return $ret . $url;
     }
     return $ret;
 }
開發者ID:sym660,項目名稱:lulucms2,代碼行數:8,代碼來源:Resource.php

示例15: getEnvData

 private function getEnvData()
 {
     $isWritable = [['係統臨時文件(data/runtime)', true, FileHelper::canWrite(LuLu::getAlias('@data/runtime')), '係統核心', '必須可讀寫'], ['附件上傳目錄(data/attachment)', false, FileHelper::canWrite(LuLu::getAlias('@data/attachment')), '附件上傳', '若無附件上傳可不用寫權限'], ['數據備份目錄(data/backup)', false, FileHelper::canWrite(LuLu::getAlias('@data/backup')), '數據庫備份', '若不備份數據庫可不用寫權限'], ['配置文件目錄(data/config)', false, FileHelper::canWrite(LuLu::getAlias('@data/attachment')), '安裝程序', '若手動安裝係統寫可不用寫權限'], ['公共資源文件(statics/assets)', true, FileHelper::canWrite(LuLu::getAlias('@statics/assets')), '係統核心', '必須可讀寫']];
     $requirements = array(['PHP版本', true, version_compare(PHP_VERSION, "5.4.0", ">="), '係統核心', 'PHP 5.4.0 或更高版本是必須的.'], ['$_SERVER 服務器變量', true, 'ok' === ($message = Utility::checkServerVar()), '係統核心', $message], ['Reflection 擴展模塊', true, class_exists('Reflection', false), '係統核心', ''], ['PCRE 擴展模塊', true, extension_loaded("pcre"), '係統核心', ''], ['SPL 擴展模塊', true, extension_loaded("SPL"), '係統核心', ''], ['PDO 擴展模塊', true, extension_loaded('pdo'), '所有和使用PDO數據庫連接相關的類', ''], ['PDO MySQL 擴展模塊', true, extension_loaded('pdo_mysql'), 'MySql數據庫', '使用MySql數據庫必須支持'], ['OpenSSL 擴展模塊', true, extension_loaded('openssl'), 'Security', '加密和解密方法'], ['GD 擴展模塊', false, 'ok' === ($message = Utility::checkCaptchaSupport()), 'CaptchaAction', $message]);
     $requireResult = 1;
     foreach ($requirements as $i => $requirement) {
         if ($requirement[1] && !$requirement[2]) {
             $requireResult = 0;
         } else {
             if ($requireResult > 0 && !$requirement[1] && !$requirement[2]) {
                 $requireResult = -1;
             }
         }
         if ($requirement[4] === '') {
             $requirements[$i][4] = '&nbsp;';
         }
     }
     $writeableResult = 1;
     foreach ($isWritable as $k => $val) {
         if ($val[1] && !$val[2]) {
             $writeableResult = 0;
         } else {
             if ($requireResult > 0 && !$val[1] && !$val[2]) {
                 $writeableResult = -1;
             }
         }
         if ($val[4] === '') {
             $isWritable[$i][4] = '&nbsp;';
         }
     }
     $data = ['isWritable' => $isWritable, 'writeableResult' => $writeableResult, 'requireResult' => $requireResult, 'requirements' => $requirements];
     return $data;
 }
開發者ID:sym660,項目名稱:lulucms2,代碼行數:33,代碼來源:SiteController.php


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