本文整理汇总了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;
}
示例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;
}
}
示例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);
}
示例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;
}