在 Joomla URL 中使用冒号的意义 [英] Significance of a using colon in Joomla URL

查看:24
本文介绍了在 Joomla URL 中使用冒号的意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道,joomla 是否对组件或视图中的冒号有任何意义?

I need to know, if joomla gives any significance to a colon in within component or view?

这个命名约定中有什么内容吗?

Is there something in this naming convention?

推荐答案

冒号仅用于 'id' 参数中,以将数字 id 与 SEF URL 使用的 slug 分开.随着视图 &组件名称不应使用任何冒号.

The colon is only used in the 'id' parameter to separate the numeric id from the slug used for SEF URLs. With view & component names you should not use any colons.

例如:非sef URL -/index.php?option=com_content&view=article&id=45:my-article-title
Sef 网址 -/my-article-title.html

Eg: Non-sef URL - /index.php?option=com_content&view=article&id=45:my-article-title
Sef URL - /my-article-title.html

此外,在实际使用 id 时,您应该只使用数字部分,可以在代码中使用 JRequest::getInt('id') 提取.

Also when actually using the id, you should only use the numeric part, which can be extracted using JRequest::getInt('id') in your code.

这篇关于在 Joomla URL 中使用冒号的意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆