Task #8491

link.action and uri.action differ in absolute argument

Added by Bastian Waidelich about 5 years ago. Updated over 3 years ago.

Status:Needs Feedback Start date:2010-06-24
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

0%

Category:ViewHelpers
Target version:-
Has patch:No

Description

In r3548 the "absolute" argument of the link.action ViewHelper has been removed with following comment:
"[~TASK][~API] Fluid (ViewHelper): The ActionViewhelper now produces only absolute URIs. The argument "absolute" is now obsolete."

I don't understand why this would make sense.. And if it does, shouldn't the uri.action ViewHelper be changed accordingly?

History

#1 Updated by Sebastian Kurfuerst about 5 years ago

added Robert and Karsten as watchers, so they get notified and can comment :)

#2 Updated by Karsten Dambekalns over 3 years ago

  • Subject changed from ActionLink ViewHelper only generates absolute links since r3548 to link.action and uri.action differ in absolute argument
  • Category set to ViewHelpers
  • Assigned To set to Karsten Dambekalns
  • Priority changed from -- undefined -- to Should have
  • Has patch set to No

I just asked Robert about this and he cannot remember anything :)

I am not sure about the usefulness of relative URLs here, but I doubt the inconsistency introduced should stay as it is…

Does anyone have an opinion on this?

#3 Updated by Bastian Waidelich over 3 years ago

Karsten Dambekalns wrote:

Does anyone have an opinion on this?

I still have the same one as "over 1 year ago" - doesn't happen too often ;)
For URIs you usually set the absolute argument more often (in E-Mails, JavaScript, ...) but IMO this should be in sync with link.uri anyways (and for links, creating relative URIs by default makes absolute sense)

#4 Updated by Adrian Föder over 3 years ago

I have an opinion to everything. :)

Well, I feel uncomfortable with only-absolute URLs at all, although I can't reason this properly. So that's only IMHO.

Definitely the behavior of both should equal; couldn't even one extend the other? The URL handling and their options are and must be always equal together, so maybe it's possible to let the TagViewHelper (link) extend the other one...? Btw that's maybe beyond scope, but you asked ;-)

#5 Updated by Adrian Föder over 3 years ago

ah, now I understand; so, the default, usual behavior is/was to have absolute URLs when using URI, and relative ones when using LINK? OK, that makes sense for the reason Karsten mentioned, but I'd still like to keep the possibility to control this: sometimes for example I need to store an internal action URI to a data- attribute or even to <form action=""> we all know.

Conclusion: at least for JavaScript and AJAX tricks it's useful to have the uri.action output still relative.

#6 Updated by Bastian Waidelich over 3 years ago

Ok, there was some confusion. I'll try to recap:

uri.action and link.action both used to have an argument absolute that defaults to FALSE.
That has been changed for link.action: The argument has been removed completely and links are now always absolute.
That does not make sense to me. We could change the default to be TRUE but I would vote against that too as relative links should be used by default IMO (you have to take care of the base tag and so, but that's another issue).

Re: Tag-based ViewHelper extending other ViewHelpers. That would be nice, but it's currently not possible because PHP only allows one parent which is "AbstractTagBasedViewHelper" for Tag-VH. But it will be possible with mixins (or even with traits in 5.4)

Also available in: Atom PDF