【发布时间】:2012-03-09 15:46:03
【问题描述】:
为什么在JRoute类中没有带_的方法,但我们使用它??,JRoute类只扩展了JObjects,但是_函数在哪里?在joomla中
【问题讨论】:
标签: php joomla content-management-system
为什么在JRoute类中没有带_的方法,但我们使用它??,JRoute类只扩展了JObjects,但是_函数在哪里?在joomla中
【问题讨论】:
标签: php joomla content-management-system
你用的是什么版本?如果你去to the API page,你有这个源代码:
class JRoute
{
/**
* Translates an internal Joomla URL to a humanly readible URL.
*
* @param string $url Absolute or Relative URI to Joomla resource.
* @param boolean $xhtml Replace & by & for XML compilance.
* @param integer $ssl Secure state for the resolved URI.
* 1: Make URI secure using global secure site URI.
* 0: Leave URI in the same secure state as it was passed to the function.
* -1: Make URI unsecure using the global unsecure site URI.
*
* @return The translated humanly readible URL.
*
* @since 11.1
*/
public static function _($url, $xhtml = true, $ssl = null)
{
// Get the router.
$app = JFactory::getApplication();
$router = $app->getRouter();
// Make sure that we have our router
if (!$router)
{
所以方法就在那里,从一开始就定义了(或多或少的第 33 行)。
在此处查找该方法的文档:http://api.joomla.org/Joomla-Platform/JRoute.html#method_
【讨论】:
libraries/joomla/methods.php。如果您熟悉 find 命令 (UNIX),您会发现浏览 joomla 源代码要容易得多;例如find /path/to/joomla/ -name '*.php' -exec grep -l '^class JRoute$' {} \;