ebavs / slim3-skeleton
Simple Slim Framework 3 skeleton
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Type:project
Requires
- dompdf/dompdf: v0.7.0
- monolog/monolog: ^1.13
- robmorgan/phinx: v0.5.3
- slim/csrf: 0.6.0
- slim/flash: ^0.1.0
- slim/slim: ^3.0
- slim/twig-view: ^2.0
- tracy/tracy: v2.3.11
- tuupola/slim-basic-auth: 2.0.3
This package is not auto-updated.
Last update: 2024-11-18 13:41:40 UTC
README
Composer Packages in this Skeleton:
slim/slim
slim/twig-view
slim/flash
monolog/monolog
robmorgan/phinx
tuupola/slim-basic-auth
dompdf/dompdf
slim/csrf
tracy/tracy
Install composer packages:
composer update
Phinx Initialize:
vendor/bin/phinx init
vendor/bin/phinx create InitialDatabase
Phinx migrate database:
vendor/bin/phinx migrate
Nginx configuration for work in subfolder:
location /base-web {
root /var/sites/base-web;
rewrite ^/base-web/?(.*)$ /base-web/public/$1 last;
}
location /base-web/public {
try_files $uri $uri/ /base-web/public/index.php$is_args$args;
}
Then change base_path in app/config/settings.php
When You create a Controller or Model, extend for their base because you can access the container:
final class HomeAction extends BaseAction
{
public function __invoke(Request $request, Response $response, $args)
{
/**
* @var $model \App\Models\HomeModel
*/
$model = $this->container['model.home'];
$data = $model->homeTest();
$this->view->render($response, 'normal-example.twig', [
'data' => $data
]);
}
}
This is a very earlier approach to Silm Skeleton for our projects.