tgrj / tweb_core
minimalistic framework core
v0.0.7
2026-03-04 21:59 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^12.0
README
minimalistic framework core
About
I wanted to have some really minimalistic PHP framework. I like noodlehaus/dispatch. Still I wanted to have some further stuff on top of it; e.g. with this package some kind of auto loading of the routes.
It also contains some basic config system.
It is a class less framework. All functions are also without a namespace.
First time doing such a thing with composer and packagist etc. on my own. I am just an amateur - so please use with care!
Usage
- tweb_autoload(string $path)
- With this function you can load either an absolute path or a relative path to the project folder and it will load all included PHP files ("require_once").
- tweb_config(string $key)
- This will get the config value of the given key. This key can be some better readable array-depth like for
[ 'a' => [ 'aa' => 1, 'ab' => 2 ] ]you could use'a.ab'as a key to get the config value2. There is a default config (tweb.conf.php) in the modules src folder, By default you can createconfig/tweb.conf.phprelative from the project path. It should return an array. This is able to overwrite the default values, but you can also have your own config keys and values. By overwriting the global variables$TWEB_CONFIG_PATHand$TWEB_CONFIG_FILEyou can define in which folder the user config is stored. You should change these values before callingtweb_config()for the first time.
- This will get the config value of the given key. This key can be some better readable array-depth like for