XF 2.2 get current xf URL/path value inside template?

yar

Member
I am looking for a way how to retrieve current URL/path inside template? Want to inject it inside href="...." value, to redirect user back where he was on forum. Maybe there is some var or func that holds it? current_url(), {{ $current_url }}, etc ?

Thanks!
 
It's available using $xf.uri for relative URLs, or $xf.fullUri for absolute URLs.

$xf.uri is exactly what I needed! Thanks!

Two more questions from this context-
1) Did I miss some documentation where to look for all the variables and functions available for use inside templates? (so I bother you less next time)
2) Is it safe to use: <a href="{{ link('/hard/coded?q=' . $xf.uri) }}">.... from the perspective of XSS attack? (i.e. if I can trust $xf.uri as the one coming from XF and thus fully verified and sanitized/encoded/etc)

Thanks again!
 
Back
Top Bottom