当前位置: 首页>>代码示例>>PHP>>正文


PHP Site::getResource方法代码示例

本文整理汇总了PHP中Site::getResource方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::getResource方法的具体用法?PHP Site::getResource怎么用?PHP Site::getResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Site的用法示例。


在下文中一共展示了Site::getResource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 function indexAction()
 {
     $minimum = Site::getResource('cashout_minimum');
     $session = new Zend_Session_Namespace('user');
     if ($session->user->balance < $minimum) {
         $this->view->cashout_failedMinimum = true;
     }
     if ($this->getRequest()->isPost()) {
         $this->request();
         $this->view->cashout_showConfirmation = true;
     }
 }
开发者ID:kakarot1991,项目名称:paid-to-click-cms,代码行数:12,代码来源:IndexController.php

示例2: approveAction

 function approveAction()
 {
     $user = $this->getRequest()->getParam('user');
     $cashout = Cashout_Models_Cashout::getUsersLastPendingCashout($user);
     if ($cashout != null) {
         $cashout->completionDate = date('Y-m-d');
         $cashout->approve();
         $user = User_Models_User::getUser($user);
         $pay[$user->paymentEmail] = $cashout->amount;
         //now send the payment to the user
         $paymentGateway = Site::getInstance(Site::getResource('payment_gateway'));
         $paymentGateway->pay($pay);
     }
     $this->getResponse()->setRedirect('/cashout/admin/requests');
 }
开发者ID:kakarot1991,项目名称:paid-to-click-cms,代码行数:15,代码来源:AdminController.php

示例3: postDispatch

 function postDispatch(Zend_Controller_Request_Abstract $request)
 {
     //make sure the requested module is not disabled
     $module = $this->getRequest()->getModuleName();
     if ($module != 'default') {
         $module = ModuleInfo::getModule($this->getRequest()->getModuleName());
         if (isset($module['status']) && $module['status'] != 'active') {
             $this->getResponse()->setRedirect('/');
         }
     }
     $front = Zend_Controller_Front::getInstance();
     $layout = Zend_Layout::getMvcInstance();
     $savedMenus = unserialize(Site::getResource('site_menu'));
     $menus = array();
     $sections = self::getSections();
     foreach ($savedMenus as $moduleMenus) {
         self::getModulePages($sections, $moduleMenus, $menus);
     }
     $layout->getView()->navigation(new Zend_Navigation($menus));
 }
开发者ID:kakarot1991,项目名称:paid-to-click-cms,代码行数:20,代码来源:NavigationPlugin.php

示例4: isValid

 public function isValid($value)
 {
     $min = Site::getResource('fund_min');
     $max = Site::getResource('fund_max');
     $this->_messageTemplates[self::MSG_MIN_ERROR] = str_replace('%d', $min, $this->_messageTemplates[self::MSG_MIN_ERROR]);
     $this->_messageTemplates[self::MSG_MAX_ERROR] = str_replace('%d', $max, $this->_messageTemplates[self::MSG_MAX_ERROR]);
     if (!preg_match('/^(\\d{2,})\\.\\d{2}$/', $value)) {
         $this->_error(self::MSG_INVALID);
         return FALSE;
     } else {
         if ($value < $min) {
             $this->_error(self::MSG_MIN_ERROR);
             return FALSE;
         } else {
             if ($value > $max) {
                 $this->_error(self::MSG_MAX_ERROR);
                 return FALSE;
             }
         }
     }
     return TRUE;
 }
开发者ID:kakarot1991,项目名称:paid-to-click-cms,代码行数:22,代码来源:Currency.php

示例5: indexAction

 function indexAction()
 {
     $session = new Zend_Session_Namespace('user');
     $form = new Fund_Models_Forms_Fund();
     $minimum = Site::getResource('fund_minimum');
     $maximum = Site::getResource('fund_maximum');
     if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
         $fund = Fund_Models_FundAccount::getUsersLastFundAccount('pending');
         if ($fund == NULL) {
             $args = array('ownerID' => $session->user->accountID, 'startDate' => date('Y-m-d'), 'status' => 'pending', 'amount' => $form->getValue('amount'));
             $fund = new Fund_Models_FundAccount($args);
         }
         $fund->amount = $form->getValue('amount');
         $fund->save();
         $session->user->lastFundTransaction = $fund;
         //display pay button
         $paymentGateway = Site::getInstance(Site::getResource('payment_gateway'));
         $paymentGateway->returnUrl = 'http://www.project.supersaid.net/fund/complete';
         $paymentGateway->cancelUrl = 'http://www.project.supersaid.net/fund/cancel';
         $this->view->form = $paymentGateway->getForm($fund);
     } else {
         $this->view->form = $form;
     }
 }
开发者ID:kakarot1991,项目名称:paid-to-click-cms,代码行数:24,代码来源:IndexController.php


注:本文中的Site::getResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。