Download the PHP package asaokamei/slim4-starter without Composer
On this page you can find all versions of the php package asaokamei/slim4-starter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asaokamei/slim4-starter
More information about asaokamei/slim4-starter
Files in asaokamei/slim4-starter
Package slim4-starter
Short Description my starter project for Slim4 + PHP-DI .
License MIT
Informations about the package slim4-starter
Slim4 and PHP-DI Starter Project
A starter project for ordinary web sites, based on slim/slim-skeleton.
Uses,
- Slim4,
- PHP-DI,
- nyholm/psr7,
- monolog,
- Twig (using
slim/twig-view
) - Aura/Session
- filp/whoops
- vlucas/phpdotenv
License
MIT License
Demo
installation.
run demo, after installation.
AbstractController
App\Controllers\AbstractController
provides useful features,
such as;
- execute class method based on http method.
- bind arguments with input value.
- modify input value.
For instance, the method onPost
is executed when
http method is post.
execution of method.
- if
action
method is present, always executeaction
. - check http method, and execute
on{$method}
. - post with
_method
to specify http method other than 'GET' and 'POST'.
bind argument
For route, /users/{user_id}
, the argument $user_id
is bound with
the route variable, {user_id}
.
modify input value
You can modify the input value using a arg{$InputKey}
method in a controller.
- Return a single value to replace the original input value,
as shown in
argTags
. - Or, return an associative array to create a new entry,
as shown in
argUserId
.
Twig Functions
additional functions for Twig.
csrf_token()
CSRF tokens in hidden tag for Slim-Csrf.
(was hidden_csrf_token()
)
path(string $routeName, array $data = [], array $queryParams = [])
Get the url for a named route
(same as url_for()
in slim/twig-view).
url(string $routeName, array $data = [], array $queryParams = [])
Get the full url for a named route.
(same as full_url_for()
in slim/twig-view).
More Functions from slim/twig-view.
is_current_url(string $routeName, array $data = [])
check if the route name is the current URL.
current_url(bool $withQueryString = false)
Get the current path.
get_uri()
Get Psr\Http\Message\UriInterface
object.
base_path()
Get base path string.
All versions of slim4-starter with dependencies
nyholm/psr7-server Version ^1.0.0
slim/http Version ^1.0
slim/csrf Version ^1.0
slim/slim Version ^4.0
monolog/monolog Version ^2.0
php-di/php-di Version ^6.1
vlucas/phpdotenv Version ^5.2
slim/twig-view Version ^3.0
ext-json Version *
filp/whoops Version ^2.7
aura/session Version ^2.1