cfif 中的正则表达式检查 URL 中是否有参数?
我试图仅在参数 ?staff 附加到 URL 时才显示代码块,例如:
仅当当前 URL 加载了 www.blank.com/folder/?staff 时才显示链接
有什么想法吗?
I'm trying to display a block of code only if the parameter ?staff is appended to URL, e.g.:
display Link only if the current URL was loaded with www.blank.com/folder/?staff
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不认为存在任何性能差异,但对我来说,最佳实践是使用
StructKeyExists(url,'staff')
而不是isDefined("url.staff")< /代码>。不过,任何一个都肯定能完成工作。
I don't believe there is any kind of performance difference, but to me it's best practices to use
StructKeyExists(url,'staff')
rather thanisDefined("url.staff")
. Either one will definitely get the job done though.您不需要使用正则表达式解析 url,如果已定义,它应该已经在 url 变量中
You don't need to parse the url with a regex, It should be in the url variable already if defined