bludit/kernel/helpers/redirect.class.php
Diego Najar 29d06b62a3 mac
2015-03-08 14:02:59 -03:00

39 lines
714 B
PHP

<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
class Redirect {
public static function url($html_location)
{
if(!headers_sent())
{
header("Location:".$html_location, TRUE, 302);
exit;
}
exit('<meta http-equiv="refresh" content="0; url='.$html_location.'" />');
}
public static function controller($base, $controller, $action, $parameters = array())
{
$url = '';
foreach( $parameters as $key=>$value )
{
$url .= '&'.$key.'='.$value;
}
self::url(HTML_PATH_ROOT.$base.'.php?controller='.$controller.'&action='.$action.$url);
}
}
?>