本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::addJsFooterLibrary方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::addJsFooterLibrary方法的具体用法?PHP PageRenderer::addJsFooterLibrary怎么用?PHP PageRenderer::addJsFooterLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Page\PageRenderer
的用法示例。
在下文中一共展示了PageRenderer::addJsFooterLibrary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeAction
/**
* Initializes the rendering action.
*
* Use this method to add all static assets.
*/
public function initializeAction()
{
if (!$this->cache->has('brushes')) {
return;
}
$themeCss = $this->resolveFilePathReference(sprintf(self::CSS_PATH . '/shCore%s.css', $this->settings['code_snippet']['theme']));
$this->pageRenderer->addCssFile($themeCss);
$coreJs = $this->resolveFilePathReference(self::JS_PATH . '/shCore.min.js');
$this->pageRenderer->addJsFooterLibrary('codesnippet_core', $coreJs);
$autoloaderJs = $this->resolveFilePathReference(self::JS_PATH . '/shAutoloader.min.js');
$this->pageRenderer->addJsFooterLibrary('codesnippet_autoloader', $autoloaderJs);
}
示例2: testAddJsFooterLibrary
/**
* test add JS footer library file
*/
public function testAddJsFooterLibrary()
{
$expectedRegExp = '#<script src="fileadmin/test\\.(js|\\d+\\.js|js\\?\\d+)" type="text/javascript"></script>#';
$this->fixture->addJsFooterLibrary('test', 'fileadmin/test.js');
$out = $this->fixture->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_FOOTER);
$this->assertRegExp($expectedRegExp, $out);
}
示例3: render
/**
* Render the URI to the resource. The filename is used from child content.
*
* @param string $file The relative path of the resource (relative to Public resource directory of the extension).
*/
public function render($file = NULL)
{
if (!$this->arguments['extensionName']) {
$this->arguments['extensionName'] = $this->controllerContext->getRequest()->getControllerExtensionName();
}
$uri = 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored($this->arguments['extensionName']) . $this->getResourcesPathAndFilename($file);
$uri = GeneralUtility::getFileAbsFileName($uri);
$uri = substr($uri, strlen(PATH_site));
switch ($this->arguments['where']) {
case 'footer':
$this->pageRenderer->addJsFooterFile($uri, $this->arguments['type'], $this->arguments['compress'], $this->arguments['forceOnTop'], $this->arguments['allWrap'], $this->arguments['excludeFromConcatenation']);
break;
case 'footerLibs':
$this->pageRenderer->addJsFooterLibrary($this->arguments['key'], $uri, $this->arguments['type'], $this->arguments['compress'], $this->arguments['forceOnTop'], $this->arguments['allWrap'], $this->arguments['excludeFromConcatenation']);
break;
default:
$this->pageRenderer->addJsFile($uri, $this->arguments['type'], $this->arguments['compress'], $this->arguments['forceOnTop'], $this->arguments['allWrap'], $this->arguments['excludeFromConcatenation']);
break;
}
}