Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Generating urls in Garden
ddumont
✭✭
Are there utilities for this?
My two examples:
I'd like to get the location of the rss image
/applications/dashboard/design/images/rss.gif
But I need a safe way of linking it in case the forum is in a subdirectory... etc...
I also need a safe way of generating a URL to get to a specific post.
Any ideas?
My two examples:
I'd like to get the location of the rss image
/applications/dashboard/design/images/rss.gif
But I need a safe way of linking it in case the forum is in a subdirectory... etc...
I also need a safe way of generating a URL to get to a specific post.
Any ideas?
There was an error rendering this rich post.
0
Comments
For a link to a discussion, you can simply do Url('/discussion/'.$DiscussionID) or you could do the full Url('/discussion/'.$DiscussionID.'/'.Gdn_Format::Url($DiscussionName))
There was an error rendering this rich post.
For images use Asset() not Url(), because Url() with rewrite.urls = off gives you index.php?p=applications/dashboard/design/images/rss.gif
For urls use Url(). I use Gdn_Format::Clean() for last part.
There was an error rendering this rich post.
Do you know if this is necessary? I think I was copying some core vanilla code that did not use Clean on the discussion name.
There was an error rendering this rich post.