Fluid
                                
                                
                                
                                    Fluid copied to clipboard
                            
                            
                            
                        Namespace declaration in output
I'm using the following template:
{namespace fx=Peregrinus\Flockr\Core\ViewHelpers}
<f:for each="{css}" as="file"><link rel="stylesheet" type="text/css" href="{f:if(condition: '{file.external}', else: '{baseUrl}')}{file.href}{f:if(condition: '{file.external}', else: '?{fx:format.date(format: \'U\')}')}"/>
</f:for>
The namespace for my ViewHelper is resolved correctly, but the following line appears in the output:
{namespace fx=Peregrinus\Flockr\Core\ViewHelpers}
Shouldn't this be suppressed?
The syntax looks correct and should work. Is it possible you use a custom RenderingContext which prevents this line from executing, causing it to not return the namespace detection processor?
https://github.com/TYPO3/Fluid/blob/master/src/Core/Rendering/RenderingContext.php#L131
No, this is just basic standalone Fluid. Also, the namespace IS being detected, just the declaration is passed through to the output.
Here's everything view-related that's happening in my controller: https://gist.github.com/potofcoffee/1992b31e67a96bd1122f1022c22590b4
Thanks for the example! I checked the template processor and it does indeed not replace the detected namespace with an empty string (which it should do). This one will need a bugfix.
To avoid it you can use $view->getRenderingContext()->getViewHelperResolver()->addNamespace($alias, $namespace); which should be easy enough since you already use a controller with access to the view :)
Hey. This has been fixed with various refactorings of involed classes meanwhile, has it?
Hey. I'm going to close here for now: I guess this has been fixed meanwhile. If this is still a problem, we may be better off with a fresh issue and would fix it quickly, but I hope this does not happen, even without looking up too many all details and doing an hour of code archaeology. I fear not too much will happen with this issue anymore, it's 7 years old by now, so I close hoping it's fixed.