本文整理汇总了PHP中SSViewer::get_base_tag方法的典型用法代码示例。如果您正苦于以下问题:PHP SSViewer::get_base_tag方法的具体用法?PHP SSViewer::get_base_tag怎么用?PHP SSViewer::get_base_tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SSViewer
的用法示例。
在下文中一共展示了SSViewer::get_base_tag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($request)
{
if (!Director::is_cli() && !isset($_GET['run'])) {
DB::alteration_message('Must add ?run=1', 'error');
return false;
}
if (!Director::is_cli()) {
// - Add UTF-8 so characters will render as they should when debugging (so you can visualize inproperly formatted characters easier)
// - Add base_tag so that printing blocks of HTML works properly with relative links (helps with visualizing errors)
?>
<head>
<?php
echo SSViewer::get_base_tag('');
?>
<meta charset="UTF-8">
</head>
<?php
}
increase_time_limit_to(300);
WordpressDatabase::$default_config = $this->config()->default_db;
$this->db = $this->wordpressImportService->getDatabase();
// Login as default admin so 'canPublish()' definitely returns true in 'SiteTree::doPublish()'
if (!Member::currentUser()) {
$defaultAdmin = Member::default_admin();
if ($defaultAdmin && $defaultAdmin->exists()) {
Session::set('loggedInAs', $defaultAdmin->ID);
}
}
// Unsure if the importing functionality can ever hit this, but just incase.
if (Versioned::current_stage() !== 'Stage') {
throw new Exception('Versioned::current_stage() must be "Stage".');
}
$this->runCustom($request);
}
开发者ID:silbinarywolf,项目名称:silverstripe-wordpressmigrationtools,代码行数:34,代码来源:WordpressImportBasicTask.php
示例2: showform
public function showform()
{
return "<head>" . SSViewer::get_base_tag("") . "</head>" . $this->Form()->forTemplate();
}