app/
_views/
_errors/
401.php
403.php
404.php
user/
add.php
get.php
core/
config.php
user.php
hr/
department.php
.settings.php
bootstrap.php
lib/
z/
form.php
route.php
view.php
logs/
public/
css/
fonts/
images/
js/
index.php
user.php
app/
_views/
_errors/
401.php
403.php
404.php
user/
add.php
get.php
core/
config.php
user.php
hr/
department.php
.settings.php
bootstrap.php
lib/
z/
form.php
route.php
view.php
logs/
public/
css/
fonts/
images/
js/
index.php
user.php
app/bootstrap.php is prepended to every .php files in the public/ folder.
My controllers are in the public/ folder and look like this:
then in my viewView 'user/get.php' I will do something like:
thisThis is then wrapped in an 'html.php' layout by the view class.
The core\config class:
The core\user class:
The hr\department class look like:
As the application is getting bigger, I would like some advice on my code, can. Can you see problems with the way I'm doing things?
edit #1
I removed the path constant as I didn't really needed them.
edit #2 About the view class, I can use a different layout from inside a controller like this:
About the view class, I can use a different layout from inside a controller like this $view = new view('view.php', 'layout.php');
$view = new view('view.php', 'layout.php');