本文整理匯總了PHP中SiteTree::MarkupMeta方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteTree::MarkupMeta方法的具體用法?PHP SiteTree::MarkupMeta怎麽用?PHP SiteTree::MarkupMeta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SiteTree
的用法示例。
在下文中一共展示了SiteTree::MarkupMeta方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GenerateWindowsPinicon
/**
* Generates markup for the Windows pinicon
*
* @param SiteConfig $config
* @param SiteTree $owner
* @param $metadata
* @param Image $WindowsPinicon
*
* @return void
*/
protected function GenerateWindowsPinicon(SiteConfig $config, SiteTree $owner, &$metadata, Image $WindowsPinicon)
{
// header
$metadata .= $owner->MarkupComment('Windows Pinned Icon');
// application name
$appName = $config->fetchPiniconTitle();
if (!$appName) {
$appName = $config->Title;
}
$metadata .= $owner->MarkupMeta('application-name', $appName);
// tile background color
if ($config->fetchWindowsPiniconBackgroundColor()) {
$metadata .= $owner->MarkupMeta('msapplication-TileColor', $config->fetchWindowsPiniconBackgroundColor());
}
// small tile
$metadata .= $owner->MarkupMeta('msapplication-square70x70logo', $WindowsPinicon->Fill(70, 70)->getAbsoluteURL());
// medium tile
$metadata .= $owner->MarkupMeta('msapplication-square150x150logo', $WindowsPinicon->Fill(150, 150)->getAbsoluteURL());
// @todo: Implement wide & tall tiles
// wide tile
// $metadata .= $owner->MarkupMeta('msapplication-square310x150logo', $WindowsPinicon->Fill(310,150)->getAbsoluteURL());
// large tile
// $metadata .= $owner->MarkupMeta('msapplication-square310x310logo', $WindowsPinicon->Fill(310,310)->getAbsoluteURL());
}
開發者ID:graphiques-digitale,項目名稱:silverstripe-seo-icons,代碼行數:34,代碼來源:SEO_Icons_SiteTree_DataExtension.php
示例2: updateMetadata
/**
* Updates metadata fields.
*
* @param SiteConfig $config
* @param SiteTree $owner
* @param string $metadata
*
* @return void
*/
public function updateMetadata(SiteConfig $config, SiteTree $owner, &$metadata)
{
// metadata
$metadata .= $owner->MarkupComment('Metadata');
// charset
if ($config->CharsetEnabled()) {
$metadata .= '<meta charset="' . $config->Charset() . '" />' . PHP_EOL;
}
// canonical
if ($config->CanonicalEnabled()) {
$metadata .= $owner->MarkupLink('canonical', $owner->AbsoluteLink());
}
// title
if ($config->TitleEnabled()) {
$metadata .= '<title>' . $owner->encodeContent($owner->GenerateTitle(), $config->Charset()) . '</title>' . PHP_EOL;
}
// description
if ($description = $owner->GenerateDescription()) {
$metadata .= $owner->MarkupMeta('description', $description, $config->Charset());
}
// extra metadata
if ($config->ExtraMetaEnabled()) {
$metadata .= $owner->MarkupComment('Extra Metadata');
$metadata .= $owner->GenerateExtraMeta();
}
}
開發者ID:graphiques-digitale,項目名稱:silverstripe-seo-metadata,代碼行數:35,代碼來源:SEO_Metadata_SiteTree_DataExtension.php