本文整理汇总了PHP中TYPO3\CMS\Frontend\Page\PageRepository::getPage方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRepository::getPage方法的具体用法?PHP PageRepository::getPage怎么用?PHP PageRepository::getPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\Page\PageRepository
的用法示例。
在下文中一共展示了PageRepository::getPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Retrieve page details from given page id
*
* @param integer $pageId
* @param string $as
* @return string Rendered string
*/
public function render($pageId, $as = 'page')
{
$this->templateVariableContainer->add($as, $this->pageRepository->getPage($pageId));
$output = $this->renderChildren();
$this->templateVariableContainer->remove($as);
return $output;
}
示例2: collectPages
/**
* return void
*/
protected function collectPages()
{
$rootline = $this->pageRepository->getRootLine($GLOBALS['TSFE']->id);
foreach ($rootline as $page) {
$this->collectPage($this->pageRepository->getPage($page['uid']));
}
$this->generateUrlCollection();
}
示例3: isGetPageHookCalled
/**
* Tests whether the getPage Hook is called correctly.
*
* @test
*/
public function isGetPageHookCalled()
{
// Create a hook mock object
$className = uniqid('tx_coretest');
$getPageHookMock = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageHookInterface', array('getPage_preProcess'), array(), $className);
// Register hook mock object
$GLOBALS['T3_VAR']['getUserObj'][$className] = $getPageHookMock;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'][] = $className;
// Test if hook is called and register a callback method to check given arguments
$getPageHookMock->expects($this->once())->method('getPage_preProcess')->will($this->returnCallback(array($this, 'isGetPagePreProcessCalledCallback')));
$this->pageSelectObject->getPage(42, FALSE);
}
示例4: indexAction
/**
* renders the given theme
*
* @return void
*/
public function indexAction()
{
$this->templateName = $this->evaluateTypoScript('plugin.tx_themes.settings.templateName');
$templateFile = $this->getTemplateFile();
if ($templateFile !== NULL) {
$this->view->setTemplatePathAndFilename($templateFile);
}
$this->view->assign('templateName', $this->templateName);
$this->view->assign('theme', $this->themeRepository->findByPageOrRootline($GLOBALS['TSFE']->id));
$this->view->assign('page', $this->pageRepository->getPage($GLOBALS['TSFE']->id));
$this->view->assign('data', $this->pageRepository->getPage($GLOBALS['TSFE']->id));
$this->view->assign('TSFE', $GLOBALS['TSFE']);
}
示例5: getPages
/**
* Get pages from Database
*
* @return array
*/
private function getPages()
{
$rootPageId = $this->pluginConfig['1']['urlEntries.']['pages.']['rootPageId'];
$rootPage = $this->pageRepo->getPage($rootPageId);
$pages = $this->getSubPagesRecursive($rootPageId);
return array_merge([$rootPage], $pages);
}
示例6: findByIdentifier
protected function findByIdentifier($identifier)
{
$page = $this->pageRepository->getPage((int) $identifier);
if (is_array($page) && isset($page['uid'])) {
return $this->createDomainObject($page);
}
return null;
}
示例7: resolveShortcutParentPage
/**
* Resolves shortcuts for the shortcut of type PageRepository::SHORTCUT_MODE_PARENT_PAGE.
*
* @param array $page
* @param array $processedPages
* @return array
*/
private function resolveShortcutParentPage(array $page, array &$processedPages)
{
$page = $this->pageRepository->getPage($page['pid'], FALSE);
if ($page && $page['doktype'] == PageRepository::DOKTYPE_SHORTCUT) {
$page = $this->resolveShortcutProcess($page, $processedPages);
}
return $page;
}
示例8: getPage
/**
* Wrapper for \TYPO3\CMS\Frontend\Page\PageRepository::getPage()
*
* @param integer $pageUid
* @return array
*/
public function getPage($pageUid = NULL)
{
if (NULL === $pageUid) {
$pageUid = $GLOBALS['TSFE']->id;
}
if (FALSE === isset(self::$cachedPages[$pageUid])) {
self::$cachedPages[$pageUid] = self::$pageSelect->getPage($pageUid);
}
return self::$cachedPages[$pageUid];
}
示例9: previewShowsPagesFromLiveAndCurrentWorkspace
/**
* @test
*/
public function previewShowsPagesFromLiveAndCurrentWorkspace()
{
// initialization
$wsid = 987654321;
// simulate calls from tslib_fe->fetch_the_id()
$this->pageSelectObject->versioningPreview = TRUE;
$this->pageSelectObject->versioningWorkspaceId = $wsid;
$this->pageSelectObject->init(FALSE);
// check SQL created by t3lib_pageSelect->getPage()
$GLOBALS['TYPO3_DB']->expects($this->once())->method('exec_SELECTquery')->with('*', 'pages', $this->stringContains('(pages.t3ver_wsid=0 or pages.t3ver_wsid=' . $wsid . ')'));
$this->pageSelectObject->getPage(1);
}
示例10: canCacheUrl
/**
* Checks if the URL can be cached. This function may prevent RealURL cache
* pollution with Solr or Indexed search URLs. Also some doktypes are ignored
* for the cache.
*
* @param string $url
* @return bool
*/
protected function canCacheUrl($url)
{
$bannedUrlsRegExp = $this->configuration->get('cache/banUrlsRegExp');
$result = !$bannedUrlsRegExp || !preg_match($bannedUrlsRegExp, $url);
if ($result) {
// Check page type: do not cache separators
$pageRecord = $this->pageRepository->getPage($this->urlParameters['id']);
if (is_array($pageRecord) && ($pageRecord['doktype'] == PageRepository::DOKTYPE_SPACER || $pageRecord['doktype'] == PageRepository::DOKTYPE_RECYCLER)) {
$result = false;
}
}
return $result;
}
示例11: indexAction
/**
* renders the given theme.
*
* @return void
*/
public function indexAction()
{
$this->templateName = $this->evaluateTypoScript('plugin.tx_themes.settings.templateName');
$templateFile = $this->getTemplateFile();
if ($templateFile !== null) {
$this->view->setTemplatePathAndFilename($templateFile);
}
$this->view->assign('templateName', $this->templateName);
$frontendController = $this->getFrontendController();
$this->view->assign('theme', $this->themeRepository->findByPageOrRootline($frontendController->id));
// Get page data
$pageArray = $this->pageRepository->getPage($frontendController->id);
$pageArray['icon'] = '';
// Map page icon
if (isset($pageArray['tx_themes_icon']) && $pageArray['tx_themes_icon'] != '') {
$setup = $frontendController->tmpl->setup;
$pageArray['icon'] = $setup['lib.']['icons.']['cssMap.'][$pageArray['tx_themes_icon']];
}
$this->view->assign('page', $pageArray);
$this->view->assign('data', $pageArray);
$this->view->assign('TSFE', $frontendController);
}
示例12: previewShowsPagesFromLiveAndCurrentWorkspace
/**
* @test
*/
public function previewShowsPagesFromLiveAndCurrentWorkspace()
{
// initialization
$wsid = 987654321;
$GLOBALS['TCA'] = array('pages' => $this->defaultTcaForPages);
// simulate calls from \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->fetch_the_id()
$this->pageSelectObject->versioningPreview = true;
$this->pageSelectObject->versioningWorkspaceId = $wsid;
$this->pageSelectObject->init(false);
// check SQL created by \TYPO3\CMS\Frontend\Page\PageRepository->getPage()
$GLOBALS['TYPO3_DB']->expects($this->at(2))->method('exec_SELECTgetSingleRow')->with('*', 'pages', $this->stringContains('(pages.t3ver_wsid=0 or pages.t3ver_wsid=' . $wsid . ')'));
$this->pageSelectObject->getPage(1);
}
示例13: evaluateCondition
/**
* This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers to adjust functionality.
*
* @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexiblity in overriding this method.
* @return bool
*/
protected static function evaluateCondition($arguments = NULL)
{
$pageUid = $arguments['pageUid'];
$respectSiteRoot = $arguments['respectSiteRoot'];
if (NULL === $pageUid || TRUE === empty($pageUid) || 0 === intval($pageUid)) {
$pageUid = $GLOBALS['TSFE']->id;
}
$pageSelect = new PageRepository();
$page = $pageSelect->getPage($pageUid);
if (TRUE === (bool) $respectSiteRoot && TRUE === isset($page['is_siteroot']) && TRUE === (bool) $page['is_siteroot']) {
return FALSE;
}
return TRUE === isset($page['pid']) && 0 < $page['pid'];
}
示例14: evaluateCondition
/**
* @param array $arguments
* @return bool
*/
protected static function evaluateCondition($arguments = null)
{
$pageUid = $arguments['pageUid'];
$respectSiteRoot = $arguments['respectSiteRoot'];
if (null === $pageUid || true === empty($pageUid) || 0 === intval($pageUid)) {
$pageUid = $GLOBALS['TSFE']->id;
}
$pageSelect = new PageRepository();
$page = $pageSelect->getPage($pageUid);
if ($respectSiteRoot && isset($page['is_siteroot']) && $page['is_siteroot']) {
return false;
}
return true === isset($page['pid']) && 0 < $page['pid'];
}
示例15: render
/**
* Render method
*
* @param integer $pageUid
* @param boolean $respectSiteRoot
* @return string
*/
public function render($pageUid = NULL, $respectSiteRoot = FALSE)
{
if (NULL === $pageUid || TRUE === empty($pageUid) || 0 === intval($pageUid)) {
$pageUid = $GLOBALS['TSFE']->id;
}
$pageSelect = new PageRepository();
$page = $pageSelect->getPage($pageUid);
if (TRUE === (bool) $respectSiteRoot && TRUE === isset($page['is_siteroot']) && TRUE === (bool) $page['is_siteroot']) {
return $this->renderElseChild();
}
if (TRUE === isset($page['pid']) && 0 < $page['pid']) {
return $this->renderThenChild();
} else {
return $this->renderElseChild();
}
}