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


PHP Page_Controller類代碼示例

本文整理匯總了PHP中Page_Controller的典型用法代碼示例。如果您正苦於以下問題:PHP Page_Controller類的具體用法?PHP Page_Controller怎麽用?PHP Page_Controller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: processPayment

 function processPayment($data, $form)
 {
     // 1) Get secured Eway url
     $url = $this->EwayURL();
     $response = file_get_contents($url);
     if ($response) {
         $response = Convert::xml2array($response);
         if (isset($response['Result']) && $response['Result'] == 'True' && isset($response['URI']) && $response['URI']) {
             // 2) Redirect to the secured Eway url
             $page = new Page();
             $page->Title = 'Redirection to eWAY...';
             $page->Logo = '<img src="' . $this->config()->get('logo') . '" alt="Payments powered by eWAY"/>';
             $page->Form = $this->EwayForm($response['URI']);
             $controller = new Page_Controller($page);
             $form = $controller->renderWith('PaymentProcessingPage');
             return new Payment_Processing($form);
         }
     }
     $this->Status = 'Failure';
     if ($response && isset($response['Error'])) {
         $this->Message = $response['Error'];
     }
     $this->write();
     return $this->redirectToOrder();
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-payment-eway,代碼行數:25,代碼來源:EwayPayment.php

示例2: testCart

 function testCart()
 {
     $cart = $this->objFromFixture("Order", "cart");
     ShoppingCart::singleton()->setCurrent($cart);
     $page = new Page_Controller();
     $this->assertEquals("\$8.00", (string) $page->renderWith("CartTestTemplate"));
 }
開發者ID:NobrainerWeb,項目名稱:silverstripe-shop,代碼行數:7,代碼來源:ViewableCartTest.php

示例3: processPayment

 function processPayment($data, $form)
 {
     $page = new Page();
     $page->Title = "Make payment";
     $page->Form = $this->processPaymentForm($data);
     $page->Logo = '<img src="payment_securatech/images/paymark_small.png" "payment gateway powered by Securatech" />';
     $controller = new Page_Controller($page);
     $form = $controller->renderWith("PaymentProcessingPage");
     return new Payment_Processing($form);
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-payment-securatech,代碼行數:10,代碼來源:SecurePayTechPaymentHosted.php

示例4: processPayment

 public function processPayment($data, $form)
 {
     $page = new Page();
     $page->Title = 'Redirection to Paystation...';
     $page->Logo = '<img src="' . self::$logo . '" alt="Payments powered by Paystation"/>';
     $page->Form = $this->PaystationForm();
     $controller = new Page_Controller($page);
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     $form = $controller->renderWith('PaymentProcessingPage');
     return new Payment_Processing($form);
 }
開發者ID:sheadawson,項目名稱:silverstripe-payment,代碼行數:11,代碼來源:PaystationHostedPayment.php

示例5: init

 public function init()
 {
     parent::init();
     if (strpos('/Security/ping', $this->request->getURL()) === false) {
         Page_Controller::AddRequirements();
     }
 }
開發者ID:balajijegan,項目名稱:openstack-org,代碼行數:7,代碼來源:OpenStackIdSecurityController.php

示例6: init

 public function init()
 {
     //Pull in parent properties for controller e.g css & js assets
     parent::init();
     Requirements::css($this->ThemeDir() . '/css/module-page.css');
     Requirements::css($this->ThemeDir() . '/css/tron-devices.min.css');
 }
開發者ID:dunatron,項目名稱:onbaord-revamp,代碼行數:7,代碼來源:ModulePage.php

示例7: init

 /**
  * Allow this controller to be viewed when the site is in draft mode.
  */
 function init()
 {
     $draftsecurity = Session::get('unsecuredDraftSite');
     Session::set("unsecuredDraftSite", true);
     parent::init();
     Session::set("unsecuredDraftSite", $draftsecurity);
 }
開發者ID:helpfulrobot,項目名稱:burnbright-silverstripe-shop-productfinder,代碼行數:10,代碼來源:ProductFinder.php

示例8: init

 public function init()
 {
     parent::init();
     $themeDir = SSViewer::get_theme_folder();
     Requirements::javascript('framework/thirdparty/jquery/jquery.js');
     if (Locator::getLocations()) {
         Requirements::javascript('http://maps.google.com/maps/api/js?sensor=false');
         Requirements::javascript('locator/thirdparty/handlebars/handlebars-v1.3.0.js');
         Requirements::javascript('locator/thirdparty/jquery-store-locator/js/jquery.storelocator.js');
     }
     Requirements::css('locator/css/map.css');
     $featured = Locator::getLocations(array('Featured' => 1))->count() > 0 ? 'featuredLocations: true' : 'featuredLocations: false';
     // map config based on user input in Settings tab
     // AutoGeocode or Full Map
     $load = $this->data()->AutoGeocode ? 'autoGeocode: true, fullMapStart: false,' : 'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,';
     $base = Director::baseFolder();
     $themePath = $base . '/' . $themeDir;
     $listTemplatePath = file_exists($themePath . '/templates/location-list-description.html') ? $themeDir . '/templates/location-list-description.html' : 'locator/templates/location-list-description.html';
     $infowindowTemplatePath = file_exists($themePath . '/templates/infowindow-description.html') ? $themeDir . '/templates/infowindow-description.html' : 'locator/templates/infowindow-description.html';
     // in page or modal
     $modal = $this->data()->ModalWindow ? 'modalWindow: true' : 'modalWindow: false';
     $kilometer = $this->data()->Unit == 'km' ? 'lengthUnit: "km"' : 'lengthUnit: "m"';
     $link = $this->Link() . 'xml.xml';
     // init map
     if (Locator::getLocations()) {
         Requirements::customScript("\n                \$(function(\$) {\n                    \$('#map-container').storeLocator({\n                        " . $load . "\n                        dataLocation: '" . $link . "',\n                        listTemplatePath: '" . $listTemplatePath . "',\n                        infowindowTemplatePath: '" . $infowindowTemplatePath . "',\n                        originMarker: true,\n                        " . $modal . ',
                     ' . $featured . ",\n                        slideMap: false,\n                        zoomLevel: 0,\n                        distanceAlert: 120,\n                        formID: 'Form_LocationSearch',\n                        inputID: 'Form_LocationSearch_address',\n                        categoryID: 'Form_LocationSearch_category',\n                        distanceAlert: -1,\n                        " . $kilometer . '
                 });
             });
         ');
     }
 }
開發者ID:jeffwhitfield,項目名稱:silverstripe-locator,代碼行數:32,代碼來源:Locator.php

示例9: init

 public function init()
 {
     if (!Permission::check("ADMIN")) {
         Security::permissionFailure();
     }
     parent::init();
 }
開發者ID:Thingee,項目名稱:openstack-org,代碼行數:7,代碼來源:EmailUtilsPage.php

示例10: init

 function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss");
     Requirements::css('jobs/css/jobs.css');
     Requirements::javascript('jobs/js/jobs.js');
 }
開發者ID:hogepodge,項目名稱:openstack-org,代碼行數:7,代碼來源:JobHolder.php

示例11: init

 /**
  * Load all the custom jquery needed to run the custom
  * validation
  */
 public function init()
 {
     parent::init();
     $ui = new Colorbox();
     $ui->initialize();
     Requirements::css(ASSETS_GALLERY_BASE . '/css/AssetsGallery.css');
 }
開發者ID:helpfulrobot,項目名稱:exadium-silverstripe-module-assets-gallery,代碼行數:11,代碼來源:AssetsGallery.php

示例12: init

    public function init()
    {
        parent::init();
        // Page Specific Includes
        Requirements::customScript('
		 
		  //VITALSCRIPT!!!
		  jQuery("a.sendmessage").bind("click", function(){
			 var myval = $(this).attr("id");
			 jQuery("#SendForm_SendForm_CleanupID").attr("value", myval);
		  });


		  jQuery(".invite").fancybox({
			  "titleShow"		: "false",
			  "transitionIn"		: "elastic",
			  "transitionOut"		: "elastic"
			});

		  //VITALSCRIPT!!!
		  jQuery("a.invite").bind("click", function(){
			 var myval = $(this).attr("id");
			 jQuery("#InviteForm_InviteForm_CleanupID").attr("value", myval);
		  });

		  ');
    }
開發者ID:SustainableCoastlines,項目名稱:loveyourwater,代碼行數:27,代碼來源:MyEvents.php

示例13: init

 public function init()
 {
     /* Inherit initialisation from parent SiteTree */
     parent::init();
     //Include the CSS in the users selected theme to ensure the calendar styles correctly
     Requirements::css("torindul-silverstripe-calendar/css/calendar.css");
 }
開發者ID:helpfulrobot,項目名稱:torindul-torindul-silverstripe-calendar,代碼行數:7,代碼來源:Calendar.php

示例14: init

 function init()
 {
     parent::init();
     Requirements::themedCSS('ElectricVehicleCalculator', 'electric-vehicle-calculator');
     Requirements::javascript("framework/thirdparty/jquery/jquery.js");
     Requirements::javascript("electric-vehicle-calculator/thirdparty/chartjs/Chart.min.js");
 }
開發者ID:sunnysideup,項目名稱:silverstripe-electric-vehicle-calculator,代碼行數:7,代碼來源:EVCPage.php

示例15: init

 public function init()
 {
     $ageMonth = Cookie::get('bmonth');
     $ageDay = Cookie::get('bday');
     $ageYear = Cookie::get('byear');
     $age = Cookie::get('age');
     $allowed_urls = array('/age-gate/');
     if ($age == NULL) {
         if (!$this->isSearchEngine()) {
             if (!in_array($_SERVER['REQUEST_URI'], $allowed_urls)) {
                 Session::set('AgeGateBackURL', urlencode($_SERVER['REQUEST_URI']));
                 $this->redirect(Director::absoluteBaseURL() . "age-gate/");
             }
         }
     } else {
         if (!in_array($_SERVER['REQUEST_URI'], $allowed_urls)) {
             if ($ageMonth == NULL || $ageDay == NULL || $ageYear == NULL) {
                 if (!in_array($_SERVER['REQUEST_URI'], $allowed_urls)) {
                     Session::set('AgeGateBackURL', urlencode($_SERVER['REQUEST_URI']));
                 }
                 $this->redirect(Director::absoluteBaseURL() . "age-gate/");
             }
         }
     }
     parent::init();
 }
開發者ID:helpfulrobot,項目名稱:moosylvania-silverstripe-age-gate,代碼行數:26,代碼來源:AgeGatedPage.php


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