Currently my project is following the following structure.
// SESSAO
if(($SisFuncoes->verificaPermissaoSecao($secao, 'home')) || $secao == null){
// requerindo a home do site.
require("html_home.php");
}
elseif($SisFuncoes->verificaPermissaoSecao($secao, 'cadastrar')){
require("html_cadastrar.php");
}
//.
//.
//.
elseif($SisFuncoes->verificaPermissaoSecao($secao, 'admin_usuarios', 3)){
require("html_admin_usuarios.php");
}
elseif($SisFuncoes->verificaPermissaoSecao($secao, 'questionario', 1)){
require("html_questionario.php");
}
else{
// requerindo a home do site.
require("html_home.php");
}
These validations are in the index.php file so the user's navigation is done through secao=questionario, secao=cadastrar
..., so navigation is done all over the site and is done without directly accessing other pages only with the use of require.
This is instead of using require and working with "$PHP_SELF/secao=cadastrar"
I thought of something similar to the example: "$ PHP_SELF / cadatrar.php" using second mode I will directly access the .php file
My question is which one would bring me better performance, keep access only to index.php with require or direct access to files?