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