- Why this project ?
- How to use it
2.1 Structure
2.2 Built-in Functions - What can you achieve and what you cannot
- Contributors
There is a massive amount of tools, technologies you can use to build a website. Unlike commonly used PHP frameworks such as Symphony or Laravel, the U-LF targets young developers or ones who aim to build a structured, tiny project like a résumé or a personal website without the need to download dozens of libraries before writing a single line of code. You can view like an intro to the framework's world, or the result of a guy who passionately hates non-structured code.
Like any librarie and frameworks, there are a couple a things to know to use it properly.
The U-LF uses an MVC (Model-View-Controller) architecture. The project is actually provided with the following folder structure:
- /
- App/
Contains all the PHP back-end such as Controllers, Models, Modules...etc
- Controller/
Contains every controllers of the application
- Modules/
Contains all extensions for the project (such as database driver, custom routing, authentication libraries...etc)
- Controller/
- config/
Contains all configuration files of the application. Each file MUST return a PHP associative array
- public/
This is your app web root. It contains all your public resources such as index.php, images, css, js files...
- resources/
Contains front-end resources such as views, languages, view layouts, templates...
- layouts/
Contains all your HTML layouts
- views/
Contains all your HTML views
- layouts/
- routes/
Contains all routes of your application. Each file is considered as it's own namespace.
- vendor/
Will be generated when you first run composer install . It contains all your dependencies. It is recommended to not touch it unless you know exactly what you are doing.
- App/
Usecases define the place where those functions are designed to be called from.
dd($var)
: Dump debug function. Will stop currently running script and print$var
value.config($key)
: Call a configuration value. Example:config("core.paths.controllers")
. Default base path is config/
view($path)
: Call a front-end HTML view.
asset($path)
: Call an asset file (default base path is public/assets).layout($path)
: Call an HTML layout from resources layouts (default base path is resources/layouts).sec($var)
: Sanitize$var
before displaying it in view, avoiding XSS vulnerabilities.
controller($path)
: Call a controller (default base path is App/Controllers)module($path)
: Call a module file (default base path is App/Modules)
This framework targets tiny projects such as resume, personal websites or young developers who want to learn with a pre-structured project without the need of having a 6 month course before starting to understand how to use it properly.
It is NOT intended to use it in big or critical projects, you'll need to rewrite the wheel for every single thing you want to achieve and you certainly will fail.
I'm the only maintainer of this project and will be.