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.
Options

accessing Gdn_Format::Url() within Smarty?

codegruntcodegrunt New
edited January 2011 in Vanilla 2.0 - 2.8
Howdy. I have run into an issue while templating where I need to create the friendly URL for a discussion. The problem is that {$DiscussionData} holds the discussion's "Name" value but this needs to be passed through Gdn_Format::Url() to sanify it.

My current work around was to create a custom Smarty plugin that exposes the Url() method to Smarty's modifier functionality:

function smarty_modifier_format_url($Url, $Default = '') { return(Gdn_Format::Url($Url)); }

Does anyone know if this the only way to achieve this (i.e. is this already handled in some other fashion?)

Cheers
Sign In or Register to comment.