1
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 user navigation is done through secao=questionario, secao=cadastrar..., thus browsing the entire site and done without directly accessing the other pages only with the use of require.
This is instead of using the require and working with using "$PHP_SELF/secao=cadastrar" I thought of something similar to the example: "$PHP_SELF/cadatrar.php" using the second mode I will directly access the.php file.
My question is which would bring me better performance, maintain access only to index.php with the use of require or direct access to files ?
Your answer is really very good. A framework with routes always seems to me a much better maintenance option than a lot of includes.
– jlHertel
Thank you very much, for the tip of F3 still studying this framework, I will try to go studying and posting the contents to help the community.
– Bulfaitelo
You’re welcome, brother. Just an addendum: I had several mistakes when using his Mapper in a SQL Server 2003 database, so it turns on that they are not mega compatible. Other than that, I’m glad you’re helping the community. I had to give them a helping hand myself, because this framework helps me a lot.
– Daniel
@Daniel I’m studying this entire framework to realize that there are many errors regarding its documentation and consequently getting worried about its functionalities. for example the function
$f3->parse();that just doesn’t work.– Bulfaitelo
Oops, yeah, like I said, you got your problems. In the end, it’s open-source, so the solution is to participate in development when you realize something doesn’t work. Of course, there are many other micro-frameworks out there (Silex, Slim, etc...) so you don’t have to get stuck in that. This parse function I never used, but worth taking a look at the source code maybe.
– Daniel