PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/SiteNavigation/SiteNavigation/Helpers/helpers.php

https://bitbucket.org/alexamiryan/stingle
PHP | 21 lines | 11 code | 3 blank | 7 comment | 1 complexity | 00d9229565b347441f6bd7fc7b25f6f0 MD5 | raw file
 1<?php
 2/**
 3 * Call other controller with given URI.
 4 * Can be used to call different controller using some logic.
 5 * WARNING! All GET parameters are being lost upon redirection. 
 6 * 
 7 * @param string $uri
 8 */
 9function redirectController($uri){
10	$_SERVER['REQUEST_URI'] = SITE_PATH . $uri;
11	$_GET = array();
12	
13	if(Reg::get('packageMgr')->isPluginLoaded("RewriteURL", "RewriteURL")){
14		Reg::get(ConfigManager::getConfig("RewriteURL", "RewriteURL")->Objects->rewriteURL)->parseURL();
15	}
16	$newNav = Reg::get(ConfigManager::getConfig("SiteNavigation", "SiteNavigation")->Objects->RequestParser)->parse();
17	
18	Reg::register(ConfigManager::getConfig("SiteNavigation", "SiteNavigation")->ObjectsIgnored->Nav, $newNav, true);
19	
20	Reg::get(ConfigManager::getConfig("SiteNavigation", "SiteNavigation")->Objects->Controller)->exec();
21}