2017 © Pedro Peláez
 

project slim3-skeleton

Simple Slim Framework 3 skeleton

image

ebavs/slim3-skeleton

Simple Slim Framework 3 skeleton

  • Thursday, September 8, 2016
  • by fromcouch
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

slim/slim
slim/twig-view
slim/flash
monolog/monolog
robmorgan/phinx
tuupola/slim-basic-auth
dompdf/dompdf
slim/csrf
tracy/tracy

Install composer packages:, (*1)

composer update

Phinx Initialize:, (*2)

vendor/bin/phinx init

vendor/bin/phinx create InitialDatabase

Phinx migrate database:, (*3)

vendor/bin/phinx migrate

Nginx configuration for work in subfolder:, (*4)

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, (*5)

When You create a Controller or Model, extend for their base because you can access the container:, (*6)

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., (*7)

The Versions