本文整理汇总了PHP中TYPO3\CMS\Fluid\View\StandaloneView::setLayoutRootPath方法的典型用法代码示例。如果您正苦于以下问题:PHP StandaloneView::setLayoutRootPath方法的具体用法?PHP StandaloneView::setLayoutRootPath怎么用?PHP StandaloneView::setLayoutRootPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Fluid\View\StandaloneView
的用法示例。
在下文中一共展示了StandaloneView::setLayoutRootPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setLayoutRootPathsOverridesValuesSetBySetLayoutRootPath
/**
* @test
*/
public function setLayoutRootPathsOverridesValuesSetBySetLayoutRootPath()
{
$this->view->setLayoutRootPath('/foo/bar');
$this->view->setLayoutRootPaths(array('/overruled/path'));
$expected = array('/overruled/path');
$actual = $this->view->_call('getLayoutRootPaths');
$this->assertEquals($expected, $actual, 'A set layout root path was not returned correctly.');
}
示例2: setLayoutRootPath
/**
* Set layout root path if given in configuration
*
* @param array $conf Configuration array
* @return void
*/
protected function setLayoutRootPath(array $conf)
{
$layoutRootPath = isset($conf['layoutRootPath.']) ? $this->cObj->stdWrap($conf['layoutRootPath'], $conf['layoutRootPath.']) : $conf['layoutRootPath'];
if ($layoutRootPath) {
$layoutRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($layoutRootPath);
$this->view->setLayoutRootPath($layoutRootPath);
}
}
示例3: getLayoutSourceReturnsContentOfDefaultLayoutFileIfNoLayoutExistsForTheSpecifiedFormat
/**
* @test
*/
public function getLayoutSourceReturnsContentOfDefaultLayoutFileIfNoLayoutExistsForTheSpecifiedFormat()
{
$layoutRootPath = __DIR__ . '/Fixtures';
$this->view->setLayoutRootPath($layoutRootPath);
$this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('foo'));
$expectedResult = file_get_contents($layoutRootPath . '/LayoutFixture');
$actualResult = $this->view->_call('getLayoutSource', 'LayoutFixture');
$this->assertEquals($expectedResult, $actualResult);
}