How you could render templates with prepared variables is shown within a request util class.
But for the routes there is the handler in the same util class that matches specified routes in an associated array.
Example of how to setup autoload setup file.
Php offers many file system functions option which are close to GNU utils by their names.
Examples with explanation in regards to file uploading and handling.
The file access options are modified with content-disposition header. That is file can be viewed, downloaded etc.
An example shows how to set this header.
Mysqli offers parameter binding which is a must for avoiding SQL injections.
To make a dry run you can either:
- The same query but as a SELECT;
- Use transations.
With this sequence, made changes would not be made in database, even though rows would be shown as affected:
$mysqli->rollback();
$mysqli->commit();
$stmt->close();
Cheatsheet from the official mariadb website.
Also, SQL cheatsheet from SQL turorial could come in handy.
Session usage is neatly explained in this stackoverflow question.
One good approach of time handling is to use UTC initially and then adjust it to a relevant timezone if needed.
This example shows how this can be accomplished.
The 100 top-most used functions in php by exakat.
Most useful algorithms that could be useful.
- Istall & enable vim mode extension, e.g., VSCode neovim.
- Set relative line numbers:
- Settings (CTRL+comma) > Line Numbers > Change from "On" to "relative".