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


PHP Core::app方法代碼示例

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


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

示例1: init

 public function init($sName, $sLayout = 'index')
 {
     $this->sName = $sName;
     $this->sPath = Core::app()->config()->getThemesPath() . '/' . $sName;
     $this->sUrl = Core::app()->config()->getThemesUrl() . '/' . $sName;
     $classLayout = $this->layoutClass;
     $this->oLayout = new $classLayout($sLayout);
     $aTheme = Loader::loadConfigFile(Core::app()->config()->getThemesPath() . '/' . $sName, 'theme');
     if ($aTheme && isset($aTheme['Client']['Packages']) && count($aTheme['Client']['Packages'])) {
         foreach ($aTheme['Client']['Packages'] as $itm) {
             Core::app()->client()->registerPackage($itm);
         }
     }
     if ($aTheme && isset($aTheme['Client']['ScriptFiles']) && count($aTheme['Client']['ScriptFiles'])) {
         foreach ($aTheme['Client']['ScriptFiles'] as $itm) {
             Core::app()->client()->registerScriptFile($itm);
         }
     }
     if ($aTheme && isset($aTheme['Client']['CssFiles']) && count($aTheme['Client']['CssFiles'])) {
         foreach ($aTheme['Client']['CssFiles'] as $itm) {
             Core::app()->client()->registerCssFile($itm);
         }
     }
     return true;
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:25,代碼來源:Theme.class.php

示例2: attach

 public function attach($owner)
 {
     if (Core::app()->checkInstalledModule($this->module_alias)) {
         parent::attach($owner);
         return true;
     }
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:7,代碼來源:GalleryBehavior.class.php

示例3: import

 public function import($aData)
 {
     $this->sPath = $aData['Project']['Path'];
     $this->sUrl = $aData['Project']['Url'];
     $this->sLang = $aData['Project']['Language'];
     $this->sDefaultLang = $aData['Project']['DefaultLanguage'];
     $this->bDebugMode = $aData['Project']['DebugMode'];
     $aFilters = array_merge_recursive($aData['Core']['Filters'], $aData['Core']['Applications'][Core::app()->getName()]['Filters']);
     foreach ($aFilters as $key => $value) {
         if (is_numeric($key)) {
             $this->aFilters[$value] = array();
         } else {
             $this->aFilters[$key] = $value;
         }
     }
     $this->aEvents = array_merge($aData['Core']['Events'], $aData['Core']['Applications'][Core::app()->getName()]['Events']);
     $this->aExtensions = array_merge($aData['Core']['Extensions'], $aData['Core']['Applications'][Core::app()->getName()]['Extensions']);
     $this->aDb = $aData['Db'];
     $this->aCache = $aData['Cache'];
     $this->sThemesPath = $this->sPath . '/themes';
     $this->sThemesUrl = $this->sUrl . '/themes';
     $this->aDefault = isset($aData['Core']['Applications'][Core::app()->getName()]['Default']) ? $aData['Core']['Applications'][Core::app()->getName()]['Default'] : array();
     $this->aRoutes = isset($aData['Core']['Applications'][Core::app()->getName()]['Routes']) ? $aData['Core']['Applications'][Core::app()->getName()]['Routes'] : array();
     //$this->aModules = $aData['Modules'];
     return true;
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:26,代碼來源:Config.class.php

示例4: check

 public function check($sValue)
 {
     if (!preg_match("%^[A-Za-z0-9](([_\\.\\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\\.\\-]?[a-zA-Z0-9]+)*)\\.([A-Za-z])+\$%", $sValue)) {
         return Core::app()->t('Ruxon', $this->getErrorText(), ['Field' => $this->getTitle()], null, 'ruxon/framework/messages');
     }
     return true;
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:7,代碼來源:ValidationEmailRule.class.php

示例5: check

 public function check($sValue)
 {
     if (is_numeric($sValue) && $sValue > 0 || is_array($sValue) && count($sValue) > 0 || is_string($sValue) && strlen($sValue) > 0) {
         return true;
     }
     return Core::app()->t('Ruxon', $this->sErrorText, ['Field' => $this->getTitle()], null, 'ruxon/framework/messages');
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:7,代碼來源:ValidationRequiredRule.class.php

示例6: sendResponse

 public function sendResponse($params)
 {
     if ($params['status'] == 'ok') {
         echo "OK" . $params['order_id'];
         Core::app()->hardEnd();
         return true;
     }
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:8,代碼來源:PaymentRobokassa.class.php

示例7: run

 public function run(FilterChain $oFilterChain)
 {
     if (Core::app()->request()->isAjaxRequest()) {
         $oFilterChain->next();
     } else {
         throw new RxException('Your request is not valid.', 400);
     }
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:8,代碼來源:AjaxOnlyFilter.class.php

示例8: run

 public function run(FilterChain $oFilterChain)
 {
     $aDb = Core::app()->config()->getCache();
     foreach ($aDb as $k => $val) {
         Manager::getInstance()->getCache()->add(Cache::factory($val['Driver'], $val['Params']), $k);
     }
     $oFilterChain->next();
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:8,代碼來源:CacheFilter.class.php

示例9: run

 public function run(FilterChain $oFilterChain)
 {
     if (Toolkit::getInstance()->auth->checkAdminAccess()) {
         $oFilterChain->next();
     } else {
         header("Location: " . Toolkit::getInstance()->auth->loginUrl);
         Core::app()->hardEnd();
     }
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:9,代碼來源:AdminAccessFilter.class.php

示例10: check

 public function check($sValue)
 {
     if (is_numeric($sValue) && $sValue > 0 || !is_numeric($sValue)) {
         if (mb_strlen($sValue, "utf8") <= $this->nMaxLength) {
             return true;
         }
     }
     return Core::app()->t('Ruxon', $this->getErrorText(), ['Field' => $this->getTitle(), 'EndLength' => $this->nMaxLength], null, 'ruxon/framework/messages');
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:9,代碼來源:ValidationMaxLengthRule.class.php

示例11: check

 public function check($sValue, $nElementId)
 {
     $oMatchValidator = new ValidationMatchRule(array($this->getAlias(), $this->getTitle(), "/^([A-Za-z]{1})([A-Za-z0-9_-]+)\$/i"));
     $oUniqValidator = new ValidationUniqRule(array($this->getAlias(), $this->getTitle(), $this->getModule(), $this->getModel(), $this->getCriteria()));
     if (strlen($sValue) >= 3 && $oMatchValidator->check($sValue) === true && $oUniqValidator->check($sValue, $nElementId) === true) {
         return true;
     }
     return Core::app()->t('Ruxon', $this->getErrorText(), ['Field' => $this->getTitle()], null, 'ruxon/framework/messages');
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:9,代碼來源:ValidationAliasRule.class.php

示例12: check

 public function check($sValue)
 {
     if (isset($_SESSION['rx_captcha']) && $_SESSION['rx_captcha'] == $sValue) {
         unset($_SESSION['rx_captcha']);
         return true;
     }
     unset($_SESSION['rx_captcha']);
     return Core::app()->t('Ruxon', $this->getErrorText(), [], null, 'ruxon/framework/messages');
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:9,代碼來源:ValidationCaptchaRule.class.php

示例13: run

 public function run(FilterChain $oFilterChain)
 {
     $aDb = Core::app()->config()->getDb();
     foreach ($aDb as $k => $val) {
         $oDb = new Db($val['ConnectionString'], $val['Username'], $val['Password'], $val['Params']);
         $oDb->open();
         Manager::getInstance()->getDb()->add($oDb, $k);
     }
     $oFilterChain->next();
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:10,代碼來源:DbConnectionFilter.class.php

示例14: result403

 public function result403()
 {
     Core::import('Modules.Main');
     $oController = new SiteController();
     $oResult = $oController->run('403', array());
     Core::app()->response()->setStatus(403);
     Core::app()->theme()->getLayout()->setContent($oResult->getHtml());
     Core::app()->response()->setResponseText(Core::app()->theme()->fetch());
     Core::app()->end();
     Core::app()->hardEnd();
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:11,代碼來源:FrontendController.class.php

示例15: uninstall

 /**
  * Uninstall: module uninstall action
  *
  * @return boolean
  */
 public function uninstall()
 {
     // 1. remove tables
     $migrator = new MysqlDbMigrator($this->sModuleAlias);
     $migrator->migrateTo(-1);
     // 2. remove row from the modules table
     Core::app()->deleteModuleById($this->sModuleAlias);
     // 3. Delete config
     $file = RX_PATH . '/ruxon/config/modules/' . $this->sModuleAlias . '.inc.php';
     if (file_exists($file)) {
         unlink($file);
     }
     return true;
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:19,代碼來源:BaseModuleInstaller.class.php


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