Modified default controller from index.php to app.php

This commit is contained in:
absurdo 2023-10-25 13:16:30 +02:00
parent 841b16266a
commit c9365707b8
3 changed files with 51 additions and 5 deletions

View file

@ -42,7 +42,7 @@ function get_route($path_info) {
case 0:
$controller='modules/'.\PhangoApp\PhaRouter\Config::$home_module.'/controllers/index.php';
$controller='modules/'.\PhangoApp\PhaRouter\Config::$home_module.'/controllers/app.php';
return \PhangoApp\PhaRouter\get_controller($controller, []);
@ -50,7 +50,7 @@ function get_route($path_info) {
case 1:
$controller='modules/'.$arr_path[1].'/controllers/index.php';
$controller='modules/'.$arr_path[1].'/controllers/app.php';
if(in_array($arr_path[1], Config::$modules_allowed)) {

View file

@ -51,7 +51,7 @@ class Utils {
$text=preg_replace('~[^-\w]+~', '', $text);
return $text;*/
/*
$from='àáâãäåæçèéêëìíîïðòóôõöøùúûýþÿŕñÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÒÓÔÕÖØÙÚÛÝỲŸÞŔÑ¿?!¡()"|#*%,;+&$ºª<>`çÇ{}@~=^:´[]';
$to= 'aaaaaaaceeeeiiiidoooooouuuybyrnAAAAAACEEEEIIIIDOOOOOOUUUYYYBRN---------------------------------';
@ -88,9 +88,55 @@ class Utils {
$text=trim(preg_replace('~'.$replace_space.'+~', $replace_space, $text), '-');
if($replace_dot==1)
{
$text=preg_replace('~[^-\w]+~', '', $text);
return utf8_encode($text);
}
return utf8_encode($text); */
$from=iconv('utf-8', 'us-ascii//TRANSLIT', '¿?{}@~=^:´[]#*·');
$to= iconv('utf-8', 'us-ascii//TRANSLIT', '---------------');
if($replace_dot==1)
{
$from.='.';
$to.='-';
}
if($replace_barr==1)
{
$from.="/";
$to.="-";
}
//utf8_decode(urldecode($text));
$text=trim(str_replace(" ", $replace_space, $text));
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
$text=preg_replace('~[^-\w]+~', '', $text);
//$text = strtr($text, $from, $to);
//Used for pass base64 via GET that use upper, for example.
if($respect_upper==0)
{
$text = strtolower($text);
}
return $text; //iconv('us-ascii//TRANSLIT', 'utf-8', $text);
}