PHPackages                             iuravic/duktig-skeleton-web-app - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. iuravic/duktig-skeleton-web-app

ActiveProject[Framework](/categories/framework)

iuravic/duktig-skeleton-web-app
===============================

Skeleton web application with Duktig MVC micro web framework for PHP 7.1

114PHP

Since Jul 7Pushed 8y agoCompare

[ Source](https://github.com/iuravic/duktig-skeleton-web-app)[ Packagist](https://packagist.org/packages/iuravic/duktig-skeleton-web-app)[ RSS](/packages/iuravic-duktig-skeleton-web-app/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/07797126c81b71bccd29089d3272a3e7e5d224f8b8f5fd444b0f888f4eb096a7/68747470733a2f2f7472617669732d63692e6f72672f697572617669632f64756b7469672d736b656c65746f6e2d7765622d6170702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/iuravic/duktig-skeleton-web-app) [![Coverage Status](https://camo.githubusercontent.com/34748b24a36bb62ef3dbf0658cdbd94d75cc93a06adc1546bb9bb152d7a68f9f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f697572617669632f64756b7469672d736b656c65746f6e2d7765622d6170702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/iuravic/duktig-skeleton-web-app?branch=master)

duktig-skeleton-web-app
=======================

[](#duktig-skeleton-web-app)

This is a skeleton web application made with the Duktig micro MVC web framework written for PHP 7.1, based on [`iuravic/duktig-core`](https://github.com/iuravic/duktig-core) library.

Table of contents
=================

[](#table-of-contents)

- [About](#about)
    - [duktig-core package](#duktig-core-package)
- [Package design](#package-design)
    - [Dependencies](#dependencies)
    - [Core services](#core-services)
- [Install](#install)
- [Usage and application flow](#usage-and-application-flow)
    - [index.php](#index-php)
    - [AppFactory](#appfactory)
    - [Request processing and the App class](#request-processing)
- [Example project functionalities](#example-project-functionalities)
- [Configuration](#configuration)
    - [Configuration files](#configuration-files)
    - [The configuration service](#the-configuration-service)
    - [Implementing duktig-core's requirements](#implementing-duktig-cores-requirements)
    - [Registering services](#registering-services)
    - [Middleware](#middleware)
    - [Events](#events)
    - [Routes](#routes)
- [Tests](#tests)

About
=====

[](#about)

The `duktig-skeleton-web-app` is a starting point for developing your own applications with the Duktig framework. It is founded on the [`duktig-core`](https://github.com/iuravic/duktig-core) package, and it provides all its necessary dependencies. The skeleton application also contains functional examples of the Duktig framework's major features.

`duktig-core` package
---------------------

[](#duktig-core-package)

It is advisable to also inspect the [`duktig-core` documentation](https://github.com/iuravic/duktig-core) which describes the purpose and features of the Duktig framework, as well as explains its base elements and functionalities.

Package design
==============

[](#package-design)

Most of the Duktig's core services are fully decoupled from the [`duktig-core`](https://github.com/iuravic/duktig-core) package. The `duktig-core` simply describes them by defining its interfaces, and each of them is implemented as a separate package in the form of an adapter towards a readily available open-source project. This kind of approach provides high flexibility, reusability, and generally stands as a good package design.

Dependencies
------------

[](#dependencies)

The `duktig-skeleton-web-app` composes the full Duktig web application framework by using popular and tested open-source packages. Adapter packages are used simply to adapt the external packages' APIs to the core's interfaces, therefore making them usable by the [`duktig-core`](https://github.com/iuravic/duktig-core).

The following projects and packages are used here to provide the full functionalities for Duktig framework:

ProjectUsed adapter package[Guzzle HTTP messages](https://github.com/guzzle/psr7)[`duktig-http-factory-guzzle-adapter`](https://github.com/iuravic/duktig-http-factory-guzzle-adapter)[Symfony Router](https://github.com/symfony/routing)[`duktig-symfony-router-adapter`](https://github.com/iuravic/duktig-symfony-router-adapter)[Symfony Event Dispatcher](https://github.com/symfony/event-dispatcher)[`duktig-symfony-event-dispatcher-adapter`](https://github.com/iuravic/duktig-symfony-event-dispatcher-adapter)[Auryn DI container](https://github.com/rdlowrey/auryn)[`duktig-auryn-adapter`](https://github.com/iuravic/duktig-auryn-adapter)[Monolog](https://github.com/Seldaek/monolog)/[Middleman middleware dispatcher](https://github.com/mindplay-dk/middleman)[`duktig-middleman-adapter`](https://github.com/iuravic/duktig-middleman-adapter)[Twig renderer](https://github.com/twigphp/Twig)[`duktig-twig-adapter`](https://github.com/iuravic/duktig-twig-adapter)

Core services
-------------

[](#core-services)

The [`services.php`](https://github.com/iuravic/duktig-skeleton-web-app/blob/master/src/Config/services.php) file shows how these packages are implemented and configured to provide for the core functionality.

Install
=======

[](#install)

The following command creates a new project via Composer:

```
$ composer create-project -s dev iuravic/duktig-skeleton-web-app {$PROJECT_PATH}

```

The Duktig packages' repositories are currently not tagged to corresponding versions, for which I apologize at this moment, but this command will never the less correctly resolve and fetch all the dependencies and create your new project.

Usage and application flow
==========================

[](#usage-and-application-flow)

Let's take a look at a full request-to-response life-cycle, and some of its key elements, in the order in which they come up in the chain of command.

index.php
---------

[](#indexphp)

A typical index.php file would look like this:

```
