[英]how to extract a joomla url
I am trying to overwrite the mod_wrapper and I want to copy the current URL and add that specific section from it to the mod_wrapper src URL. 我正在尝试覆盖mod_wrapper,我想复制当前URL并将该特定部分从其中添加到mod_wrapper src URL。
I tried with following but it doesnt work 我尝试了以下操作,但没有用
my current URL is: mydomain/member-portal?dis_code=ABC123 我当前的网址是:mydomain / member-portal?dis_code = ABC123
now I want to extract above URL and get only ?dis_code=ABC123
现在我想提取上述URL并仅获取
?dis_code=ABC123
my mod_wrapper has following src. 我的mod_wrapper具有以下src。 but
但
src="<?php echo $url . "?" . JURI::base( true ) . "\n"; ?>"
But this doesnt work. 但这不起作用。 But Joomla Documentation has the following.
但是Joomla文档具有以下内容。
echo 'Joomla base URI is ' . JURI::base() . "\n";
echo 'Joomla base URI (path only) is ' . JURI::base( true ) . "\n";
results 结果
Joomla base URI is `mywebsite/joomla/`
Joomla base URI (path only) is /joomla
The Joomla method to get the url would be at docs.joomla.org/JURI/current 用于获取网址的Joomla方法位于docs.joomla.org/JURI/current
From there, you can extract what you need. 从那里,您可以提取所需的内容。
Try to change JURI::base() by JUri::base(). 尝试通过JUri :: base()更改JURI :: base()。 This sentence will return exactly your url.
这句话将完全返回您的网址。
echo JUri::base();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.