/**
  * Build parser configuration
  *
  * @return Tx_Fluid_Core_Parser_Configuration
  * @author Karsten Dambekalns <*****@*****.**>
  */
 protected function buildParserConfiguration()
 {
     $parserConfiguration = $this->objectManager->create('Tx_Fluid_Core_Parser_Configuration');
     if ($this->controllerContext->getRequest()->getFormat() === 'html') {
         $parserConfiguration->addInterceptor($this->objectManager->get('Tx_Fluid_Core_Parser_Interceptor_Escape'));
     }
     return $parserConfiguration;
 }
Beispiel #2
0
 /**
  * Retrieves a repository based on the supplied entity's name.
  *
  * @param  string $entityName                         The entity's name-
  * @return Tx_Extbase_Persistence_RepositoryInterface A repository.
  * @throws Tx_Powered_Exception_NoSuchRepository      If the asked repository
  *                                                    can not be found.
  * @author Romain Ruetschi <*****@*****.**>
  */
 public function getRepository($entityName)
 {
     // If there is no already registered repository for the supplied entity's name,
     if (!isset($this->repositories[$entityName])) {
         // Prepare the replacements.
         // 1. Replace "@extension" with the extension name.
         // 2. Replace "@entity" with the "ucfirsted" entity's name.
         $replacements = array('@extension' => $this->controllerContext->getRequest()->getControllerExtensionName(), '@entity' => ucfirst($entityName));
         // Build the repository class name.
         $repositoryClassName = str_replace(array_keys($replacements), array_values($replacements), $this->repositoryClassNamePattern);
         // If the class is not defined (so it does not exists),
         if (!class_exists($repositoryClassName)) {
             throw new Tx_Powered_Exception_NoSuchRepository('The repository "' . $repositoryClassName . '" cannot be found.');
         }
         // Else, store a reference to the unique instance of the repository
         $this->repositories[$entityName] = t3lib_div::makeInstance($repositoryClassName);
     }
     // Return the stored reference.
     return $this->repositories[$entityName];
 }