本文整理匯總了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')));
}