當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。