本文整理汇总了PHP中eZModule::redirectTo方法的典型用法代码示例。如果您正苦于以下问题:PHP eZModule::redirectTo方法的具体用法?PHP eZModule::redirectTo怎么用?PHP eZModule::redirectTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZModule
的用法示例。
在下文中一共展示了eZModule::redirectTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
/**
* Trasforma le variabili $_GET in view_parameters e redirige la richiesta in base al parametro $_GET['RedirectUrlAlias']
*
* @see modules/ocsearch/action.php
* @param array $requestFields
* @param eZModule $module
*/
public static function redirect(array $requestFields, eZModule $module = null)
{
$result = new OCClassSearchFormFetcher();
$result->setRequestFields($requestFields);
if ($module) {
$redirect = '/';
if (isset($requestFields['RedirectUrlAlias'])) {
$redirect = $requestFields['RedirectUrlAlias'];
} elseif (isset($requestFields['RedirectNodeID'])) {
$node = eZContentObjectTreeNode::fetch($requestFields['RedirectNodeID']);
if ($node instanceof eZContentObjectTreeNode) {
$redirect = $node->attribute('url_alias');
}
}
$redirect = rtrim($redirect, '/') . $result->getViewParametersString();
$module->redirectTo($redirect);
}
}
示例2: handleTagChooserImport
/**
* @deprecated usare un client ad hoc
*
* @param eZModule $module
* @param eZTemplate $tpl
* @param $repositoryNodeID
* @param $localParentNodeID
*
* @throws Exception
*/
protected function handleTagChooserImport(eZModule $module, eZTemplate $tpl, $repositoryNodeID, $localParentNodeID, &$Result)
{
if (isset($this->attributes['definition']['AskTagTematica']) && $this->attributes['definition']['AskTagTematica'] == true) {
$http = eZHTTPTool::instance();
if (!$http->hasPostVariable('SelectTags')) {
$tpl->setVariable('fromPage', '/repository/import/' . $this->attributes['definition']['Identifier'] . '/' . $repositoryNodeID);
$tpl->setVariable('localParentNodeID', $localParentNodeID);
$Result['content'] = $tpl->fetch('design:repository/eztagschooser.tpl');
$Result['path'] = array(array('url' => false, 'text' => 'Scegli Tag'));
return;
} else {
$tagIDs = array();
$tagKeywords = array();
$tagParents = array();
foreach ($_POST as $key => $value) {
if (substr($key, 0, 8) == 'tematica') {
list($tagID, $tagKeyword, $tagParent) = explode(";", $value);
$tagIDs[] = $tagID;
$tagKeywords[] = $tagKeyword;
$tagParents[] = $tagParent;
}
}
}
$newObject = $this->import($repositoryNodeID, $localParentNodeID);
foreach ($newObject->contentObjectAttributes() as $attribute) {
if ($attribute->contentClassAttributeIdentifier() == 'tematica') {
$eZTags = new eZTags();
$eZTags->createFromStrings(implode('|#', $tagIDs), implode('|#', $tagKeywords), implode('|#', $tagParents));
$eZTags->store($attribute);
break;
}
}
$module->redirectTo($newObject->attribute('main_node')->attribute('url_alias'));
} else {
$newObject = $this->import($repositoryNodeID, $localParentNodeID);
$module->redirectTo($newObject->attribute('main_node')->attribute('url_alias'));
}
}
示例3: redirect
/**
* Redirects the user
*
* @param eZHTTPTool $http
* @param eZModule $module
* @return mixed
*/
function redirect($http, $module)
{
$http->removeSessionVariable('NGConnectAuthResult');
$http->removeSessionVariable('NGConnectForceRedirect');
if ($http->hasSessionVariable('NGConnectLastAccessURI')) {
return $module->redirectTo($http->sessionVariable('NGConnectLastAccessURI'));
} else {
return $module->redirectTo('/');
}
}