-
Notifications
You must be signed in to change notification settings - Fork 0
11. Application Structure
This page is a more in depth look at the What happens when a page is loaded section from the introduction. The main purpose of this page is to help debugging the framework, but it can also be helpful to better understand the request cycle.
-
Apache recieves the request, and because of the
.htaccess
reroutes the request toindex.php
. -
index.php
calls theSmts::Init()
function with the unloaded config array. -
Smts::Init()
calls theEnvSetup()
function with the unloaded config array. And does the following:- Loads the config.
- Sets two headers:
X-Frame-Options: DENY
andContent-Security-Policy: frame-ancestors 'none'
, which disabled iframes of the site. - Starts the session.
- If
CustomErrors
is set to true in the config: sets all error handelers toFrameworkCore::Error
and setsdisplay_errors
to off
-
Smts::Init()
sets theSmts::$session
variable. -
Smts::Init()
gets the module/controller/action path from theGetPath()
function, if a module is selected theGetPath()
function redirects the request to that modules init function. -
Smts::Init()
callsRouteRequest()
which calls: the selected controllers BeforeAction, and then the selected action in the selected controller.
You are now in the controller code, and can call a model or Render() to get data from a model or load a view.
When the config gets loaded, the variables in the selected Env
are placed in the config.