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


PHP Director::AbsoluteBaseURL方法代碼示例

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


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

示例1: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldFromTab("Root", "Content");
     $fields->addFieldToTab("Root.Main", new TextField("BlogURL", "Blog URL Segment (eg. 'blog', 'news', etc.)"));
     if ($this->BlogURL) {
         $fields->addFieldToTab("Root.WordpressLogin", new LiteralField("Desc1", "<div id='wp-login'><h1>WordPress</h1><a href='" . Director::AbsoluteBaseURL() . $this->BlogURL . "/wp-login.php' target='_blank'>Login</a></div>"));
     }
     return $fields;
 }
開發者ID:helpfulrobot,項目名稱:iqnection-pages-basepages,代碼行數:10,代碼來源:BlogPage.php

示例2: _errorCheck

 private function _errorCheck($tweets)
 {
     if (array_key_exists('errors', $tweets)) {
         $message = 'We have encountered ' . count($tweets['errors']) . ' error(s): <br />';
         foreach ($tweets['errors'] as $error) {
             $message .= $error['message'] . ' Code:' . $error['code'] . '<br />';
         }
         if (Director::isDev()) {
             throw new Exception($message, 1);
         } else {
             if (Email::getAdminEmail()) {
                 $from = Email::getAdminEmail();
                 $to = Email::getAdminEmail();
                 $subject = "Twitter Feed Failure - " . Director::AbsoluteBaseURL();
                 $body = $message;
                 $body .= "<br /><br />Reported by " . Director::AbsoluteBaseURL();
                 $email = new Email($from, $to, $subject, $body);
                 $email->send();
             }
         }
         return true;
     }
 }
開發者ID:helpfulrobot,項目名稱:purplespider-twitter-feed,代碼行數:23,代碼來源:TwitterFeed.php

示例3: __construct

 /**
  * Initialise config
  *
  * @since version 1.0.0
  *
  * @return void
  **/
 public function __construct()
 {
     $this->objects = Config::inst()->get('SEO_Sitemap', 'objects');
     $this->url = substr(Director::AbsoluteBaseURL(), 0, -1);
 }
開發者ID:Cyber-Duck,項目名稱:Silverstripe-SEO,代碼行數:12,代碼來源:SEO_Sitemap.php

示例4: init

 /**
  * Initialise and return the SEO object
  *
  * @since version 1.0.0
  *
  * @return self Return the SEO instance
  **/
 public static function init()
 {
     if (null === static::$instance) {
         static::$instance = new static();
         // set the default URL for Meta tags like canonical
         self::setPageURL(Director::AbsoluteBaseURL() . substr(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), 1));
         // Initialise core objects
         self::$tags = new SEO_HeadTags();
         self::$sitemap = new SEO_Sitemap();
         self::$paginaton = new SEO_Pagination();
     }
     return static::$instance;
 }
開發者ID:Cyber-Duck,項目名稱:Silverstripe-SEO,代碼行數:20,代碼來源:SEO.php


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