本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::setTitle方法的具体用法?PHP PageRenderer::setTitle怎么用?PHP PageRenderer::setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Page\PageRenderer
的用法示例。
在下文中一共展示了PageRenderer::setTitle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetTitle
/**
* test set title
*/
public function testSetTitle()
{
$expectedReturnValue = '<title>This is the title</title>';
$this->fixture->setTitle('This is the title');
$out = $this->fixture->render();
$this->assertContains($expectedReturnValue, $out);
}
示例2: showAction
/**
* action show
*
* @param \Subugoe\Substaff\Domain\Model\Group $group
*/
public function showAction(\Subugoe\Substaff\Domain\Model\Group $group)
{
$this->pageRenderer->setTitle($group->getTitle());
// group's name should be shown as title
$GLOBALS['TSFE']->page['title'] = $group->getTitle();
$people = $this->personRepository->findGroupMembers($group);
$projects = $this->projectRepository->findProjectsByGroups($group->getUid());
if ($group->getParentGroup() === null) {
$subGroups = $this->groupRepository->findByParentGroup($group->getUid());
$this->view->assign('subGroups', $subGroups);
}
if ($this->settings['groupDetailTeaser']) {
$this->view->assign('showTeaser', $this->settings['groupDetailTeaser'])->assign('teaserLength', $this->settings['groupDetailTeaserLength']);
}
$this->view->assign('group', $group)->assign('people', $people)->assign('projects', $projects);
}
示例3: render
/**
* Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate and pageTitle
*
* @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
* @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
* @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
* @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
* @param bool $loadJQuery whether to load jQuery library. Defaults to FALSE
* @param array $includeCssFiles List of custom CSS file to be loaded
* @param array $includeJsFiles List of custom JavaScript file to be loaded
* @param array $addJsInlineLabels Custom labels to add to JavaScript inline labels
* @param array $includeRequireJsModules List of RequireJS modules to be loaded
* @param string $jQueryNamespace Store the jQuery object in a specific namespace
* @return void
*/
public function render($pageTitle = '', $loadExtJs = false, $loadExtJsTheme = true, $enableExtJsDebug = false, $loadJQuery = false, $includeCssFiles = null, $includeJsFiles = null, $addJsInlineLabels = null, $includeRequireJsModules = null, $jQueryNamespace = null)
{
if ($pageTitle) {
$this->pageRenderer->setTitle($pageTitle);
}
if ($loadExtJs) {
$this->pageRenderer->loadExtJS(true, $loadExtJsTheme);
if ($enableExtJsDebug) {
$this->pageRenderer->enableExtJsDebug();
}
}
if ($loadJQuery) {
$jQueryNamespace = $jQueryNamespace ?: PageRenderer::JQUERY_NAMESPACE_DEFAULT;
$this->pageRenderer->loadJquery(null, null, $jQueryNamespace);
}
// Include custom CSS and JS files
if (is_array($includeCssFiles) && count($includeCssFiles) > 0) {
foreach ($includeCssFiles as $addCssFile) {
$this->pageRenderer->addCssFile($addCssFile);
}
}
if (is_array($includeJsFiles) && count($includeJsFiles) > 0) {
foreach ($includeJsFiles as $addJsFile) {
$this->pageRenderer->addJsFile($addJsFile);
}
}
if (is_array($includeRequireJsModules) && count($includeRequireJsModules) > 0) {
foreach ($includeRequireJsModules as $addRequireJsFile) {
$this->pageRenderer->loadRequireJsModule($addRequireJsFile);
}
}
// Add inline language labels
if (is_array($addJsInlineLabels) && count($addJsInlineLabels) > 0) {
$extensionKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
foreach ($addJsInlineLabels as $key) {
$label = LocalizationUtility::translate($key, $extensionKey);
$this->pageRenderer->addInlineLanguageLabel($key, $label);
}
}
}
示例4: renderContent
/**
* Returns the fully rendered view
*
* @return string
*/
public function renderContent()
{
$this->setupPage();
$this->pageRenderer->setTitle($this->title);
$this->loadJavaScripts();
$this->setJavaScriptCodeArray();
$this->loadStylesheets();
$this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent());
if ($this->moduleId) {
$this->view->assign('moduleId', $this->moduleId);
}
if ($this->moduleName) {
$this->view->assign('moduleName', $this->moduleName);
}
$renderedPage = $this->pageRenderer->render(PageRenderer::PART_HEADER);
$renderedPage .= $this->view->render();
$renderedPage .= $this->pageRenderer->render(PageRenderer::PART_FOOTER);
return $renderedPage;
}
示例5: renderContent
/**
* Returns the fully rendered view
*
* @return string
*/
public function renderContent()
{
$this->setupPage();
$this->pageRenderer->setTitle($this->title);
$this->loadJavaScripts();
$this->setJavaScriptCodeArray();
$this->loadStylesheets();
$this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent());
if ($this->moduleId) {
$this->view->assign('moduleId', $this->moduleId);
}
if ($this->moduleName) {
$this->view->assign('moduleName', $this->moduleName);
}
$this->view->assign('flashMessageQueueIdentifier', $this->getFlashMessageQueue()->getIdentifier());
$renderedPage = $this->pageRenderer->render(PageRenderer::PART_HEADER);
$renderedPage .= $this->bodyTag;
$renderedPage .= $this->view->render();
$this->pageRenderer->addJsFooterInlineCode('updateSignals', BackendUtility::getUpdateSignalCode());
$renderedPage .= $this->pageRenderer->render(PageRenderer::PART_FOOTER);
return $renderedPage;
}
示例6: startPage
/**
* Returns page start
* This includes the proper header with charset, title, meta tag and beginning body-tag.
*
* @param string $title HTML Page title for the header
* @return string Returns the whole header section of a HTML-document based on settings in internal variables (like styles, javascript code, charset, generator and docType)
* @see endPage()
*/
public function startPage($title)
{
// hook pre start page
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'])) {
$preStartPageHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'];
if (is_array($preStartPageHook)) {
$hookParameters = array('title' => &$title);
foreach ($preStartPageHook as $hookFunction) {
GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
// alternative template for Header and Footer
if ($this->pageHeaderFooterTemplateFile) {
$file = GeneralUtility::getFileAbsFileName($this->pageHeaderFooterTemplateFile, true);
if ($file) {
$this->pageRenderer->setTemplateFile($file);
}
}
// Disable rendering of XHTML tags
$this->pageRenderer->setRenderXhtml(false);
$languageCode = $this->pageRenderer->getLanguage() === 'default' ? 'en' : $this->pageRenderer->getLanguage();
$this->pageRenderer->setHtmlTag('<html lang="' . $languageCode . '">');
$headerStart = '<!DOCTYPE html>';
$this->pageRenderer->setXmlPrologAndDocType($headerStart);
$this->pageRenderer->setHeadTag('<head>' . LF . '<!-- TYPO3 Script ID: ' . htmlspecialchars($this->scriptID) . ' -->');
header('Content-Type:text/html;charset=utf-8');
$this->pageRenderer->setCharSet('utf-8');
$this->pageRenderer->addMetaTag($this->generator());
$this->pageRenderer->addMetaTag('<meta name="robots" content="noindex,follow">');
$this->pageRenderer->addMetaTag('<meta charset="utf-8">');
$this->pageRenderer->addMetaTag('<meta name="viewport" content="width=device-width, initial-scale=1">');
$this->pageRenderer->setFavIcon($this->getBackendFavicon());
if ($this->useCompatibilityTag) {
$this->pageRenderer->addMetaTag($this->xUaCompatible($this->xUaCompatibilityVersion));
}
$this->pageRenderer->setTitle($title);
// add docstyles
$this->docStyle();
if ($this->extDirectStateProvider) {
$this->pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/JavaScript/ExtDirect.StateProvider.js');
}
$this->pageRenderer->addHeaderData($this->JScode);
foreach ($this->JScodeArray as $name => $code) {
$this->pageRenderer->addJsInlineCode($name, $code, false);
}
if (!empty($this->JScodeLibArray)) {
GeneralUtility::deprecationLog('DocumentTemplate->JScodeLibArray is deprecated since TYPO3 CMS 7. Use the functionality within pageRenderer directly');
foreach ($this->JScodeLibArray as $library) {
$this->pageRenderer->addHeaderData($library);
}
}
if ($this->extJScode) {
$this->pageRenderer->addExtOnReadyCode($this->extJScode);
}
// Load jquery and twbs JS libraries on every backend request
$this->pageRenderer->loadJquery();
// Note: please do not reference "bootstrap" outside of the TYPO3 Core (not in your own extensions)
// as this is preliminary as long as Twitter bootstrap does not support AMD modules
// this logic will be changed once Twitter bootstrap 4 is included
$this->pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('core') . 'Resources/Public/JavaScript/Contrib/bootstrap/bootstrap.js');
// hook for additional headerData
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'])) {
$preHeaderRenderHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'];
if (is_array($preHeaderRenderHook)) {
$hookParameters = array('pageRenderer' => &$this->pageRenderer);
foreach ($preHeaderRenderHook as $hookFunction) {
GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
// Construct page header.
$str = $this->pageRenderer->render(PageRenderer::PART_HEADER);
$this->JScode = $this->extJScode = '';
$this->JScodeArray = array();
$this->endOfPageJsBlock = $this->pageRenderer->render(PageRenderer::PART_FOOTER);
$str .= $this->docBodyTagBegin() . ($this->divClass ? '
<!-- Wrapping DIV-section for whole page BEGIN -->
<div class="' . $this->divClass . '">
' : '') . trim($this->form);
return $str;
}
示例7: startPage
//.........这里部分代码省略.........
// This loads the tabulator-in-textarea feature. It automatically modifies
// every textarea which is found.
if (!$GLOBALS['BE_USER']->uc['disableTabInTextarea']) {
$this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/tab.js');
}
// Include the JS for the Context Sensitive Help
if ($includeCsh) {
$this->loadCshJavascript();
}
// Get the browser info
$browserInfo = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo(GeneralUtility::getIndpEnv('HTTP_USER_AGENT'));
// Set the XML prologue
$xmlPrologue = '<?xml version="1.0" encoding="' . $this->charset . '"?>';
// Set the XML stylesheet
$xmlStylesheet = '<?xml-stylesheet href="#internalStyle" type="text/css"?>';
// Add the XML prologue for XHTML doctypes
if (strpos($this->docType, 'xhtml') !== FALSE) {
// Put the XML prologue before or after the doctype declaration according to browser
if ($browserInfo['browser'] === 'msie' && $browserInfo['version'] < 7) {
$headerStart = $headerStart . LF . $xmlPrologue;
} else {
$headerStart = $xmlPrologue . LF . $headerStart;
}
// Add the xml stylesheet according to doctype
if ($this->docType !== 'xhtml_frames') {
$headerStart = $headerStart . LF . $xmlStylesheet;
}
}
$this->pageRenderer->setXmlPrologAndDocType($headerStart);
$this->pageRenderer->setHeadTag('<head>' . LF . '<!-- TYPO3 Script ID: ' . htmlspecialchars($this->scriptID) . ' -->');
$this->pageRenderer->setCharSet($this->charset);
$this->pageRenderer->addMetaTag($this->generator());
$this->pageRenderer->addMetaTag('<meta name="robots" content="noindex,follow" />');
$this->pageRenderer->setFavIcon($this->getBackendFavicon());
if ($this->useCompatibilityTag) {
$this->pageRenderer->addMetaTag($this->xUaCompatible($this->xUaCompatibilityVersion));
}
$this->pageRenderer->setTitle($title);
// add docstyles
$this->docStyle();
if ($this->extDirectStateProvider) {
$this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/ExtDirect.StateProvider.js');
}
// Add jsCode for overriding the console with a debug panel connection
$this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', 'if (typeof top.Ext === "object") {
top.Ext.onReady(function() {
if (typeof console === "undefined") {
if (top && top.TYPO3 && top.TYPO3.Backend && top.TYPO3.Backend.DebugConsole) {
console = top.TYPO3.Backend.DebugConsole;
} else {
console = {
log: Ext.log,
info: Ext.log,
warn: Ext.log,
error: Ext.log
};
}
}
});
}
', FALSE);
$this->pageRenderer->addHeaderData($this->JScode);
foreach ($this->JScodeArray as $name => $code) {
$this->pageRenderer->addJsInlineCode($name, $code, FALSE);
}
if (count($this->JScodeLibArray)) {
foreach ($this->JScodeLibArray as $library) {
$this->pageRenderer->addHeaderData($library);
}
}
if ($this->extJScode) {
$this->pageRenderer->addExtOnReadyCode($this->extJScode);
}
// hook for additional headerData
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'])) {
$preHeaderRenderHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'];
if (is_array($preHeaderRenderHook)) {
$hookParameters = array('pageRenderer' => &$this->pageRenderer);
foreach ($preHeaderRenderHook as $hookFunction) {
GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
// Construct page header.
$str = $this->pageRenderer->render(PageRenderer::PART_HEADER);
$this->JScodeLibArray = array();
$this->JScode = $this->extJScode = '';
$this->JScodeArray = array();
$this->endOfPageJsBlock = $this->pageRenderer->render(PageRenderer::PART_FOOTER);
if ($this->docType == 'xhtml_frames') {
return $str;
} else {
$str .= $this->docBodyTagBegin() . ($this->divClass ? '
<!-- Wrapping DIV-section for whole page BEGIN -->
<div class="' . $this->divClass . '">
' : '') . trim($this->form);
}
return $str;
}
示例8: startPage
/**
* Returns page start
* This includes the proper header with charset, title, meta tag and beginning body-tag.
*
* @param string $title HTML Page title for the header
* @param bool $includeCsh flag for including CSH
* @return string Returns the whole header section of a HTML-document based on settings in internal variables (like styles, javascript code, charset, generator and docType)
* @see endPage()
*/
public function startPage($title, $includeCsh = TRUE)
{
// hook pre start page
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'])) {
$preStartPageHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'];
if (is_array($preStartPageHook)) {
$hookParameters = array('title' => &$title);
foreach ($preStartPageHook as $hookFunction) {
GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
$this->pageRenderer->backPath = $this->backPath;
// alternative template for Header and Footer
if ($this->pageHeaderFooterTemplateFile) {
$file = GeneralUtility::getFileAbsFileName($this->pageHeaderFooterTemplateFile, TRUE);
if ($file) {
$this->pageRenderer->setTemplateFile($file);
}
}
// Disable rendering of XHTML tags
$this->pageRenderer->setRenderXhtml(FALSE);
$languageCode = $this->pageRenderer->getLanguage() === 'default' ? 'en' : $this->pageRenderer->getLanguage();
$this->pageRenderer->setHtmlTag('<html lang="' . $languageCode . '">');
// Include the JS for the Context Sensitive Help
// @todo: right now this is a hard dependency on csh manual, as the whole help system should be moved to
// the extension. The core provides a API for adding help, and rendering help, but the rendering
// should be up to the extension itself
if ($includeCsh && ExtensionManagementUtility::isLoaded('cshmanual')) {
$this->loadCshJavascript();
}
$headerStart = '<!DOCTYPE html>';
$this->pageRenderer->setXmlPrologAndDocType($headerStart);
$this->pageRenderer->setHeadTag('<head>' . LF . '<!-- TYPO3 Script ID: ' . htmlspecialchars($this->scriptID) . ' -->');
header('Content-Type:text/html;charset=utf-8');
$this->pageRenderer->setCharSet('utf-8');
$this->pageRenderer->addMetaTag($this->generator());
$this->pageRenderer->addMetaTag('<meta name="robots" content="noindex,follow">');
$this->pageRenderer->addMetaTag('<meta charset="utf-8">');
$this->pageRenderer->addMetaTag('<meta name="viewport" content="width=device-width, initial-scale=1">');
$this->pageRenderer->setFavIcon($this->getBackendFavicon());
if ($this->useCompatibilityTag) {
$this->pageRenderer->addMetaTag($this->xUaCompatible($this->xUaCompatibilityVersion));
}
$this->pageRenderer->setTitle($title);
// add docstyles
$this->docStyle();
if ($this->extDirectStateProvider) {
$this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/ExtDirect.StateProvider.js');
}
// Add jsCode for overriding the console with a debug panel connection
$this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', 'if (typeof top.Ext === "object") {
top.Ext.onReady(function() {
if (typeof console === "undefined") {
if (top && top.TYPO3 && top.TYPO3.Backend && top.TYPO3.Backend.DebugConsole) {
console = top.TYPO3.Backend.DebugConsole;
} else {
console = {
log: Ext.log,
info: Ext.log,
warn: Ext.log,
error: Ext.log
};
}
}
});
}
', FALSE);
$this->pageRenderer->addHeaderData($this->JScode);
foreach ($this->JScodeArray as $name => $code) {
$this->pageRenderer->addJsInlineCode($name, $code, FALSE);
}
if (count($this->JScodeLibArray)) {
GeneralUtility::deprecationLog('DocumentTemplate->JScodeLibArray is deprecated since TYPO3 CMS 7. Use the functionality within pageRenderer directly');
foreach ($this->JScodeLibArray as $library) {
$this->pageRenderer->addHeaderData($library);
}
}
if ($this->extJScode) {
$this->pageRenderer->addExtOnReadyCode($this->extJScode);
}
// Load jquery and twbs JS libraries on every backend request
$this->pageRenderer->loadJquery();
// Note: please do not reference "bootstrap" outside of the TYPO3 Core (not in your own extensions)
// as this is preliminary as long as Twitter bootstrap does not support AMD modules
// this logic will be changed once Twitter bootstrap 4 is included
$this->pageRenderer->addJsFile($this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/bootstrap/bootstrap.js');
// hook for additional headerData
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'])) {
$preHeaderRenderHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'];
if (is_array($preHeaderRenderHook)) {
//.........这里部分代码省略.........