Download the PHP package jakobjohansson/kiwi without Composer
On this page you can find all versions of the php package jakobjohansson/kiwi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jakobjohansson/kiwi
More information about jakobjohansson/kiwi
Files in jakobjohansson/kiwi
Package kiwi
Short Description a minimalistic and lightweight blog framework
License MIT
Homepage https://github.com/jakobjohansson/kiwi
Informations about the package kiwi
kiwi

kiwi is a minimalistic and lightweight blog framework for php.
Documentation
Kiwi can be installed via Composer:
Configuration
Included in the package is a .env.example
file, which should be renamed to .env
and omitted from version control. It is a simple environment file containing fields for database settings, user settings and more general application settings. Kiwi will not run without this file.
After this is done, you should head to the /migrate route to migrate the default SQL tables.
Routes
Custom routes can be set in the app/routes.php
file, pointing a route towards a controller and a target method:
Controllers
All controllers reside in the app/Controllers
directory. An example controller is included with the following methods:
Notice the type hinted Post parameter in the show method. It will be automatically injected when you provide a wildcard in your route!
Middleware
You can apply custom middleware by creating a middleware()
method in your controller. It will run on every request directed towards the controller.
Views
As seen in the example above, views can be requested from a controller method by stating View::render($viewpath, $arrayOfData)
. The view path is relative to the app/Views
folder, with a suffixed .view.php
added at the end, meaning you can simply enter the file name.
Templating
Kiwi supports templating similar to that of Laravel Blade:
At the time of writing, the following directives are supported:
- if / elseif / else statements
- echo expressions
- foreach loops
- includes
Validation
Validation is rather simple with kiwi. Simply access a form field using the Input
class, which takes the field name as the first parameter and an array of rules as the second parameter:
The supported rules can be found in the Rule
class. At the time of writing, the following rules are supported:
- min
- max
- required
- url
- digits
- alpha
If validation fails, kiwi will redirect back with access to an $errors
variable, containing all the data you need to display an informative error message!
License
Kiwi is MIT licensed, meaning you are free modify and do as you wish with the code.