本文整理汇总了PHP中Juri::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Juri::getInstance方法的具体用法?PHP Juri::getInstance怎么用?PHP Juri::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Juri
的用法示例。
在下文中一共展示了Juri::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mark
function mark()
{
$markid = $this->input->getInt('markid');
$line = "option=com_jotcache&view=main";
$this->model->resetMark();
$uri = Juri::getInstance();
$domain = $uri->toString(array('host'));
$parts = explode('.', $domain);
$last = count($parts) - 1;
if ($last >= 1 && is_numeric($parts[$last]) === false) {
$domain = $parts[$last - 1] . '.' . $parts[$last];
}
switch ($markid) {
case 0:
setcookie('jotcachemark', '0', '0', '/', $domain);
$this->setRedirect('index.php?' . $line . "&filter_mark=", JText::_('JOTCACHE_RS_MSG_RESET'));
break;
case 1:
setcookie('jotcachemark', '1', '0', '/', $domain);
$this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_SET'));
break;
case 2:
setcookie('jotcachemark', '2', '0', '/', $domain);
$this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_RENEW'));
break;
default:
break;
}
}
示例2: clearHistoryUntil
/**
* Clear the history until the uri.
* Two uris are equal if their view and id vars are the same.
*
* @param mixed $uri The uri until
*
* @return void
*/
public function clearHistoryUntil($uri = null)
{
$history = $this->history->getQueue();
if (empty($history)) {
return;
}
if (null === $uri) {
$uri = str_replace(Juri::base(), '', Juri::getInstance()->toString());
}
$uri = new JURI($uri);
$view = $uri->getVar('view');
$id = $uri->getVar('id');
$newHistory = array();
foreach ($history as $oldLink) {
$oldUri = new Juri($oldLink);
$oldView = $oldUri->getVar('view');
$oldId = $oldUri->getVar('id');
if ($oldView === $view && $oldId === $id) {
break;
}
$newHistory[] = $oldLink;
}
$this->history->setQueue($newHistory);
}
示例3: repositoryIdentifier
/**
* @return string
*/
public function repositoryIdentifier()
{
$config = JComponentHelper::getParams('com_fabrik');
return $config->get('oai_repository_identifier', Juri::getInstance()->toString(array('host')));
}