ebavs/slim3-skeleton

There is no license information available for the latest version (dev-master) of this package.

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

dev-master 2016-09-08 13:43 UTC

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.