Feature #51277

ViewHelper context should be aware of actual file occurrence

Added by Adrian Föder almost 2 years ago.

Status:New Start date:2013-08-23
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-
Has patch:No

Description

Especially when it comes to errors, or the need of determining a package, ViewHelpers need to know in what file they are noted.

Currently I know of the following cases:

  • Every kind of error like "argument foo needs to be supplied", or exceptions thrown in ViewHelpers
  • ViewHelpers that need to find out a package name, like f:translate and the .action VHs

The last case currently attempts to get this information (the current controller, hence package) from the Request, but there are cases where the Request is not available (starting with StandaloneView). So when using a ViewHelper and skipping any "package" argument, I as the integrator would expect the package where the current file resides as the default.

I don't know that much about the parsing internals, but I think it would get really tough since Fluid works on strings rather soon, right?
Maybe Layouts, Templates and Partials can be Objects with a "sourceFile", a "sourceCode" and a __toString method, and ViewHelpers have access to these objects... just an idea... No clue if that's possible in any way.


Related issues

related to TYPO3.Fluid - Task #32035: Improve fluid error messages New 2011-11-23
related to TYPO3.Fluid - Task #34309: Unknown ViewHelpers cause exception - should be handled m... New 2012-02-26

Also available in: Atom PDF