Download the PHP package tavib47/slim-boilerplate without Composer

On this page you can find all versions of the php package tavib47/slim-boilerplate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package slim-boilerplate

Slim Framework Boilerplate

A modern PHP boilerplate built with Slim Framework 4 and Twig templating, pre-configured with DDEV for local development and code quality tools.

Prerequisites

Quick Start

  1. Create a project:

  2. Copy environment configuration:

  3. Start DDEV and install dependencies:

  4. Open in browser:

Project Setup

Before starting development, configure these files:

File Purpose
.env Environment variables (database, mail, app settings)
.ddev/config.yaml DDEV project configuration
composer.json Update project name and description

Features

Feature Description
Slim Framework 4 Fast, minimal PHP micro-framework
Twig 3 Secure template engine with inheritance and components
PHP-DI Autowiring dependency injection container
Sass/SCSS Modular stylesheets with variables and partials
Multilingual (i18n) URL-based locale detection, translated routes, YAML translations
Session Management PHP sessions with flash messages
Contact Form Ready-to-use form with SMTP email (PHPMailer)
GDPR Cookie Banner Cookie consent with localStorage
Environment Config .env file support via phpdotenv
Code Quality PHPCS, PHPStan, pre-commit hooks

Configuration

All configuration is managed via environment variables in .env:

Application

Database

Mail (SMTP)

Project Structure

Development Workflow

Starting and Stopping

Running Commands

Database Access

Adding New Pages

For static pages (using PageController), you only need two steps:

  1. Add a route to the $routes array in config/routes.php:

  2. Create a template in templates/pages/terms.twig:

Routes are automatically registered for all supported locales. To add translated URL slugs, see the Multilingual Support section.

For pages with custom logic, create a controller:

  1. Create a controller in src/Controllers/:

  2. Add a route in config/routes.php:

  3. Create a template in templates/pages/my-page.twig

Theme Development (Sass/CSS)

Stylesheets are written in Sass and compiled to CSS. Source files are in scss/, compiled output goes to public/css/style.css.

Commands

File Structure

Adding New Styles

  1. New component: Create scss/components/_my-component.scss, add @use 'my-component'; to _index.scss
  2. New page styles: Add to scss/_pages.scss or create a new partial
  3. New variables: Add to scss/_variables.scss

Each partial uses @use '../variables' as *; to access variables.

Multilingual Support (i18n)

The boilerplate includes a complete internationalization system with URL-based locale detection and translated routes. All routes defined in config/routes.php are automatically registered for each supported locale.

URL Structure

Configuration

Configure languages in config/settings.php under the locale key:

Adding Route Translations

When you add a new route, you can optionally add translated URL slugs:

  1. Add the route to config/routes.php:

  2. Add translated slugs in config/settings.php:

This will generate:

Translation Files

Translations are stored in YAML files in the translations/ directory:

Using Translations in Templates

Locale-Specific Template Overrides

You can override templates for specific locales by placing them in a locale subdirectory:

The system checks for pages/{locale}/template.twig first, then falls back to pages/template.twig.

Code Quality Tools

This boilerplate includes pre-configured code quality tools that run automatically on commit.

Available Commands

Standards

Git Hooks

Pre-commit hooks are automatically configured via composer install. They run all code quality checks before each commit.

MailHog (Email Testing)

DDEV includes MailHog for capturing outgoing emails during development.

Or visit: https://your-project.ddev.site:8026

License

MIT


All versions of slim-boilerplate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
slim/slim Version ^4.14
slim/psr7 Version ^1.7
slim/twig-view Version ^3.4
php-di/php-di Version ^7.0
vlucas/phpdotenv Version ^5.6
phpmailer/phpmailer Version ^6.9
symfony/translation Version ^7.0
symfony/yaml Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tavib47/slim-boilerplate contains the following files

Loading the files please wait ...