TYPO3  7.6
NotFoundView.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Extbase\Mvc\View;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
23 {
27  protected $variablesMarker = array('errorMessage' => 'ERROR_MESSAGE');
28 
36  public function render()
37  {
38  if (!is_object($this->controllerContext->getRequest())) {
39  throw new \TYPO3\CMS\Extbase\Mvc\Exception('Can\'t render view without request object.', 1192450280);
40  }
41  $template = file_get_contents($this->getTemplatePathAndFilename());
42  if ($this->controllerContext->getRequest() instanceof \TYPO3\CMS\Extbase\Mvc\Web\Request) {
43  $template = str_replace('###BASEURI###', \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), $template);
44  }
45  foreach ($this->variablesMarker as $variableName => $marker) {
46  $variableValue = isset($this->variables[$variableName]) ? $this->variables[$variableName] : '';
47  $template = str_replace('###' . $marker . '###', $variableValue, $template);
48  }
49  return $template;
50  }
51 
57  protected function getTemplatePathAndFilename()
58  {
59  return \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('extbase') . 'Resources/Private/MVC/NotFoundView_Template.html';
60  }
61 
74  public function __call($methodName, array $arguments)
75  {
76  }
77 }