TYPO3 CMS  TYPO3_6-2
ResourceViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is part of the TYPO3 project - inspiring people to share! *
6  * *
7  * TYPO3 is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU General Public License version 2 as published by *
9  * the Free Software Foundation. *
10  * *
11  * This script is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14  * Public License for more details. *
15  * */
30 
40  public function render($path, $extensionName = NULL, $absolute = FALSE) {
41  if ($extensionName === NULL) {
42  $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
43  }
44  $uri = 'EXT:' . \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($extensionName) . '/Resources/Public/' . $path;
47  if (TYPO3_MODE === 'BE' && $absolute === FALSE && $uri !== FALSE) {
48  $uri = '../' . $uri;
49  }
50  if ($absolute === TRUE) {
51  $uri = $this->controllerContext->getRequest()->getBaseURI() . $uri;
52  }
53  return $uri;
54  }
55 }
render($path, $extensionName=NULL, $absolute=FALSE)
const TYPO3_MODE
Definition: init.php:40
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)