本文整理匯總了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;
}
}