CompileWithContentArgumentAndRenderStatic exists to simplify
a common use case of ViewHelpers: A ViewHelper should be
callable both with an argument and with its child content.
While this feature is very useful, the trait also offers a more
confusing feature: If the "content argument name" isn't defined
explicitly, it will try to guess that name by going through all
defined ViewHelper arguments and pick the first optional
argument.
This is unnecessary magic behavior, which will be removed in
the future. As preparation for that, we define the content argument
name explicitly in all existing ViewHelpers that still use the
automagic behavior.
CompileWithContentArgumentAndRenderStatic
exists to simplify a common use case of ViewHelpers: A ViewHelper should be callable both with an argument and with its child content.Example:
This can also be helpful with Fluid's inline syntax:
While this feature is very useful, the trait also offers a more confusing feature: If the "content argument name" isn't defined explicitly, it will try to guess that name by going through all defined ViewHelper arguments and pick the first optional argument.
This is unnecessary magic behavior, which will be removed in the future. As preparation for that, we define the content argument name explicitly in all existing ViewHelpers that still use the automagic behavior.