ViewHelper context should be aware of actual file occurrence
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.
No data to display