Feature #51277

ViewHelper context should be aware of actual file occurrence

Added by Adrian Föder over 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-08-23
Due date:
% Done:

0%

Estimated time:
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 messagesNew2011-11-23

Actions
Related to TYPO3.Fluid - Task #34309: Unknown ViewHelpers cause exception - should be handled more gracefulNew2012-02-26

Actions

No data to display

Also available in: Atom PDF