Feature #35766

add custom namespaces in settings.yaml

Added by rottenrice no-lastname-given over 9 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
View
Target version:
-
Start date:
2012-04-07
Due date:
% Done:

0%

Estimated time:
Has patch:
No

Description

the repeated declaration of your own namespaces in the template files is an unnecessary overhead. with this update you can define custom namespaces in your Settings.yaml.

enhanced/edited TYPO3\Fluid\Core\Parser\TemplateParser:

/**
 * Namespace identifiers and their component name prefix (Associative array).
 * @var array
 */
protected $namespaces = array();

/**
 * The FLOW3 settings
 * @var array
 */
protected $settings;

/**
 * Injects the settings and resets the namespace array
 *
 * @param array $settings The settings
 * @return void
 */
public function injectSettings(array $settings) {
    $this->settings = $settings;
    $this->reset();
}

/**
 * Resets the parser to its default values.
 *
 * @return void
 */
protected function reset() {
    $this->namespaces = array();
    if (isset($this->settings['Core']['Parser']['TemplateParser']['namespaces'])) {
        $this->namespaces = $this->settings['Core']['Parser']['TemplateParser']['namespaces'];
    }
}

added Settings.yaml in Packages/Framework/TYPO3.Fluid/Configuration (required):

TYPO3:
  Fluid:
    Core:
      Parser:
        TemplateParser:
          namespaces:
            f: 'TYPO3\Fluid\ViewHelpers'

now each package has the possibility to add custom namespaces in Packages/Application/*.*/Configuration/Settings.yaml (optional)

TYPO3:
  Fluid:
    Core:
      Parser:
        TemplateParser:
          namespaces:
            foo: 'my\foo\namespace'


Related issues

Related to TYPO3.Fluid - Major Feature #2228: Default namespacesRejected2008-11-27

Actions
Is duplicate of TYPO3.Fluid - Feature #4472: View helper namespaces should be configurableClosed2009-09-07

Actions
Has duplicate TYPO3.Fluid - Feature #58557: Define Namespaces in Configuration FileRejectedBastian Waidelich2014-05-06

Actions
#1

Updated by Sebastian Kurfuerst over 9 years ago

  • Status changed from New to Rejected

Hey there,

thanks for your ideas. Unfortunately, this is a feature we deliberately do not want as it makes Fluid Template files less interchangeable and less universally-readable. It is, in a nutshell, the same reason that XML files always need the correct namespace include set, and this can also not be done from the outside.

Best regards,
Sebastian

#2

Updated by Stefan Neufeind over 7 years ago

Same idea was also mentioned on a presentation by e-net (slide 5):
http://de.slideshare.net/enetinfo/t3ak12-extbase-11562975

Also available in: Atom PDF