本文整理汇总了PHP中CopixUrl::getCurrentUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP CopixUrl::getCurrentUrl方法的具体用法?PHP CopixUrl::getCurrentUrl怎么用?PHP CopixUrl::getCurrentUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CopixUrl
的用法示例。
在下文中一共展示了CopixUrl::getCurrentUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testValues
public function testValues()
{
CopixConfig::instance()->url_requestedscript_variable = 'PHP_SELF';
// Verifions que l'on retourne le bon hote
$this->assertEquals($_SERVER['HTTP_HOST'], CopixUrl::getRequestedDomain());
$this->assertRegexp('/^\\/.*test\\.php$/', CopixUrl::getRequestedScript());
$this->assertEquals('test.php', CopixUrl::getRequestedScriptName());
$this->assertEquals('http://', CopixUrl::getRequestedProtocol());
$currentUrl = CopixUrl::getCurrentUrl();
}
示例2: smarty_function_currenturl
/**
* Plugin smarty type fonction
* Purpose: get the current url.
*
* Input: assign = (optional) name of the template variable we'll assign
* the output to instead of displaying it directly
*
* Examples:
*/
function smarty_function_currenturl($params, &$this)
{
$assign = CopixUrl::getCurrentUrl();
if (isset($params['assign'])) {
$this->assign($params['assign'], $assign);
return '';
} else {
return $assign;
}
}
示例3: smarty_function_currenturl
/**
* Plugin smarty type fonction
* Purpose: get the current url.
*
* Input: assign = (optional) name of the template variable we'll assign
* the output to instead of displaying it directly
*
* Examples:
*/
function smarty_function_currenturl($params, &$me)
{
if (isset($params['notxml'])) {
$isxml = $params['notxml'] == 'true' ? false : true;
} else {
$isxml = true;
}
$assign = CopixUrl::getCurrentUrl($isxml);
if (isset($params['assign'])) {
$me->assign($params['assign'], $assign);
return '';
} else {
return $assign;
}
}
示例4: smarty_function_commentthis
function smarty_function_commentthis($params, &$smarty)
{
extract($params);
if (empty($displaytype)) {
$displaytype = 'list';
}
if (empty($type)) {
$smarty->trigger_error('commentthis: missing type parameter');
}
if (empty($id)) {
$smarty->trigger_error('commentthis: missing id parameter');
}
if (empty($dest)) {
$dest = CopixUrl::get('comment||getList', array('type' => $type, 'id' => $id, 'back' => $back));
}
$dao =& CopixDAOFactory::create('comment|Comment');
$services =& CopixClassesFactory::create('comment|commentservices');
$services->enableComment($id, $type);
switch ($displaytype) {
case 'link':
$nbComment = $dao->getNbComment($id, $type);
$toReturn = '<a href=' . $dest . '>' . $nbComment . ' ';
$toReturn .= $nbComment > 1 ? CopixI18N::get('comment|comment.messages.comments') : CopixI18N::get('comment|comment.messages.comment');
$toReturn .= '</a>';
break;
case 'form':
$back = CopixUrl::getCurrentUrl();
CopixActionGroup::process('comment|comment::doPrepareAdd', array('type' => $type, 'id' => $id, 'back' => $back));
$toEdit = CopixActionGroup::process('comment|comment::_getSessionComment');
$toReturn = CopixZone::process('comment|AddComment', array('toEdit' => $toEdit));
break;
case 'list':
default:
$toReturn = CopixZone::process('comment|CommentList', array('type' => $type, 'id' => $id));
break;
}
return $toReturn;
}