当前位置: 首页>>代码示例>>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;未经允许,请勿转载。