2017 © Pedro Peláez
 

project slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

image

rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  • Friday, June 1, 2018
  • by rotexdegba
  • Repository
  • 5 Watchers
  • 22 Stars
  • 345 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 12 Versions
  • 1 % Grown

The README.md

SlimPHP 4 Skeleton MVC App

Run PHP Tests and Code Quality Tools   GitHub release (latest SemVer)   GitHub   Coverage Status   GitHub code size in bytes   Packagist Downloads   GitHub top language   Packagist PHP Version Support (specify version)   GitHub commits since latest release (by date)   GitHub last commit   GitHub Release Date   Libraries.io dependency status for GitHub repo , (*1)

The documentation for the version of this framework based on SlimPHP 3 can be found here., (*2)

This is a template web-application (powered by SlimPHP 4), that can be extended to build more complex web applications., (*3)

While it is not necessary to have expert understanding of the SlimPHP 4 framework (https://www.slimframework.com/docs/v4/) in order to build web-applications with this template application framework, such understanding would help in maximizing the capabilities of this template application framework., (*4)

Features / Benefits of using the Slim MVC Framework

  • It adds the Model-View-Controller structure to your web-application. Actually, really more of Controller-View functionality with a model folder provided for housing your Model classes (leaving you with the responsibility of choosing whichever ORM / Database Access Library suits your needs or are most comfortable with), (*5)

  • Provides a skeleton folder / directory structure for your application:, (*6)

./path/to/newly/created/app
|-- config/
    |-- languages/
|       |-- en_US.php
|       `-- fr_CA.php
|   |-- app-settings.php
|   |-- app-settings-dist.php
|   |-- dependencies.php
|   |-- env.php
|   |-- env-dist.php
|   |-- ini-settings.php
|   `-- routes-and-middlewares.php
|
|-- logs/
|
|-- public/
|   |-- css/
|   |-- images/
|   |-- js/
|   `-- index.php
|
|-- src/
|   |-- controllers/
|   |-- layout-templates/
|   |-- models/
|   |-- views/
|   `-- AppErrorHandler.php
|
|-- tests/
|
|-- tmp/
|
|-- vendor/
|
|-- .gitignore
|-- composer.json
|-- composer.lock
`-- README.md
  • Provides some helper functions like sMVC_UriToString(\Psr\Http\Message\UriInterface $uri), sMVC_addQueryStrParamToUri(\Psr\Http\Message\UriInterface $uri, $param_name, $param_value), etc. in the default global namespace and a few string helper functions in the SlimMvcTools\Functions\Str namespace, (*7)

  • Provides an automatic routing scheme for mapping request urls to methods in Controller classes that are sub-classes of SlimMvcTools\Controllers\BaseController. You don't need to define any routes for your application if you adhere to using Controllers that are compatible with the routing scheme, (*8)

    • Also supports operating using only pure Slim PHP functionality (i.e. you can manually / explicitly define all or some of the routes (each of which may or may not make use of Controller classes as route handlers) and middle-wares for your application. You can also disable the automatic routing scheme described above if you plan to manually define all your routes. Manually / explicitly defined routes will override automatic routes with the same path definition)
  • Ships whith a BaseController class (i.e. SlimMvcTools\Controllers\BaseController) that provides methods for authentication (login, logout & checking authentication status), listing all methods in all controller classes in an application that can be automatically routed to if the automatic MVC routing is enabled, forcing HTTP 400, 401, 403, 404, 405, 410, 500 & 501 responses and methods for rendering php view and layout files using the light-weight and easily extensible Rotexsoft\FileRenderer\Renderer class. Take a look at the class for a full list of methods that can be used in your applications., (*9)

  • Provides a command-line script for creating Controller classes (that extend SlimMvcTools\Controllers\BaseController or any of its descendants)., (*10)

    • ./vendor/bin/smvc-create-controller on *nix-like Oses and .\vendor\bin\smvc-create-controller.bat on Windows
      • NOTE: ./vendor/bin/smvc-create-controller-wizard is the interactive version of ./vendor/bin/smvc-create-controller
  • Ships with a very minimal amount of composer / packagist dependencies (all of which are used by SlimMvcTools\Controllers\BaseController) in order to allow you to include only additional dependencies that suit the specific needs of your application. Thereby reducing the possibility of having unused / unneeded dependencies in your application. The following packages are used in this framework:, (*11)

    • Slim Framework Version 4: for routing http requests to action methods in Controller classes (or other callables acceptable by Slim for responding to requests that match defined routes) and sending back http responses to clients
    • File Renderer: for rendering php layout and view files (which basically contain a mix of php, html, css & Javascript) which will be sent back as html in http response bodies to clients. Plain Text, Json, Xml & other non-html responses can be emitted directly from Controller Action methods (they don't need this renderer)
    • Vespula Auth: a lightweight authentication package that is used by the default login & logout actions in the BaseController to authenticate users. An in-memory sqlite db is used for authentication by default, you should switch to a proper relational db like Mysql (which this package can also autheticate against)
    • Vespula Locale: another light-weight package for managing localized strings in this framework. Things like error messages during login are managed using an instance of this package to display those messages in the desired language selected by the user. US English & Canadian French are the two languages this framework supports out of the box. Other locale files can be added to the ./config/languages folder and their locale code(s) should be added to the container ($container[ContainerKeys::VALID_LOCALES]) and a link for that language should be added to the layout template with the appropriate query string so that users that click on it can set that language as their desired language when interacting with an application built with this framework
    • Vespula Log: a PSR-3 Logger that is used throughout this framework for logging various events (like successful login & logout events, etc.). It's lighter than other packages like Monolog and pretty decent.
    • Pimple: a simple Dependency Injection Container that is used to power \SlimMvcTools\Container (the PSR-11 compliant container that ships with this framework)
    • Nyholm PSR7: A fast PHP7 implementation of PSR-7 injected into SlimPHP by this framework
    • Nyholm PSR7 Server: Helper classes to handle PSR-7 server requests, also used by SlimPHP within this framework

    You should also look at the public methods available in \SlimMvcTools\Controllers\BaseController which all your applications' controller classes will be extending & which will come in handy in your applications like the forceHttp###, getResponseObjForLoginRedirectionIfNotLoggedIn, isLoggedIn, makeLink, renderLayout & renderView methods, (*12)

  • Strives to adhere strictly to the PSR-7 HTTP messages and psr/container interfaces, in order to make it easy to use different implementations of the PSR-7 request and response objects and psr/container compliant containers, (*13)

Requirements

  • PHP 7.2+ (for version 3.X) or PHP 7.4+ (for version 4.X) or PHP 8.1+ (for version 5.x)
  • Pdo sqlite (3) extension for Authentication in non-production environments
  • Composer (https://getcomposer.org)

Documentation

Branching

These are the branches in this repository:, (*14)

  • master: contains code for the latest major version of this framework > There should always be a slim-#-edition-versions-x.x branch that will be synced with master and from which the latest major versions will be tagged. The composer.json in this branch will require the most recent stable version of rotexsoft/slim-skeleton-mvc-tools as opposed to the dev-master version that will always be required in the composer.json in the master branch.
  • slim-4-edition-versions-5.x: contains code for the 5.x version of this package (currently being synced with master until a newer version 6.x starts being developed on master)
  • slim-4-edition-versions-4.x: contains code for the 4.x version of this package. No new features, only bug fixes accepted.
  • slim-3-edition: contains code for the 3.x version of this package. No new features, only bug fixes accepted.
  • 1.X: contains code for the 1.x version of this package. Abandoned.
  • project-website: contains code for the documetation website for this project (https://rotexsoft.github.io/slim-skeleton-mvc-app/).
    • THE project-website BRANCH WAS CREATED IN MAY 2024 AND IS CURRENTLY BEING DEVELOPED. WILL REMOVE THIS NOTICE WHEN THE DOCUMENTATION WEBSITE IS READY TO GO. FOR NOW KEEP READING THE DOCUMENTATION IN THE BRANCH FOR THE VERSION OF THIS FRAMEWORK YOU ARE CURRENTLY USING.

Issues

  • Please submit an issue or a pull request if you find any problems with this skeleton app.
  • If you are suggesting an enhancement please create an issue first so that it can be deliberated upon, before going on to submit a pull request.

The Versions

01/06 2018

dev-master

9999999-dev https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

01/06 2018

1.0.10

1.0.10.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

08/05 2018

1.0.9

1.0.9.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

10/10 2017

1.0.8

1.0.8.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

04/10 2017

1.0.7

1.0.7.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

03/10 2017

1.0.6

1.0.6.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

02/10 2017

1.0.5

1.0.5.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

02/10 2017

1.0.4

1.0.4.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

26/09 2017

1.0.3

1.0.3.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

26/09 2017

1.0.2

1.0.2.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

23/09 2017

1.0.1

1.0.1.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3

28/06 2017

1.0.0

1.0.0.0 https://github.com/rotexsoft/slim3-skeleton-mvc-app

This is a template mvc web-application (powered by SlimPHP 3), that can be extended to build more complex web applications.

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

framework mvc slim 3 slim3 slim-3 slimphp 3 slimphp3 slimphp-3