PHPackages                             raphhh/puppy - 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. raphhh/puppy

ActiveProject[Framework](/categories/framework)

raphhh/puppy
============

A micro-framework to create websites using Twig

1.1.0(11y ago)879MITPHPPHP &gt;=5.4

Since Apr 11Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Raphhh/puppy)[ Packagist](https://packagist.org/packages/raphhh/puppy)[ Docs](http://www.puppyframework.com)[ RSS](/packages/raphhh-puppy/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Puppy framework
===============

[](#puppy-framework)

[![Latest Stable Version](https://camo.githubusercontent.com/64e806d7ef7c3c2e72981c561e50621234c422927876465c20ff086958c5575d/68747470733a2f2f706f7365722e707567782e6f72672f7261706868682f70757070792f762f737461626c652e737667)](https://packagist.org/packages/raphhh/puppy)[![Build Status](https://camo.githubusercontent.com/1490aa2f7f1e9d453c72d84dca430c8df5feaf22f9b83021b9a4725a13039e04/68747470733a2f2f7472617669732d63692e6f72672f5261706868682f70757070792e706e67)](https://travis-ci.org/Raphhh/puppy)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/b125c874a5349e69c0a147c290f6fc07609b79535f0287fc85681ee44d0388e1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5261706868682f70757070792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Raphhh/puppy/)[![Code Coverage](https://camo.githubusercontent.com/c4ef8d3c0c34c1cb254ed0a151fafe7dd67a1ba2fd406ed3932ed8e5ddd1a2be/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5261706868682f70757070792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Raphhh/puppy/)[![Total Downloads](https://camo.githubusercontent.com/8363ce0322ca24db0b9c27d293af060341b2aacb400800be23a20aed26830ed0/68747470733a2f2f706f7365722e707567782e6f72672f7261706868682f70757070792f646f776e6c6f6164732e737667)](https://packagist.org/packages/raphhh/puppy)[![License](https://camo.githubusercontent.com/49f22272a3ab3f1945c065d36f9e9176ff4fd634a231fc3f57323fb55b007d24/68747470733a2f2f706f7365722e707567782e6f72672f7261706868682f70757070792f6c6963656e73652e737667)](https://packagist.org/packages/raphhh/puppy)

Puppy is a micro-framework built in PHP that helps you to create websites using [Twig](http://twig.sensiolabs.org/) templates!

With Puppy, you will be able to build websites directly in Twig, without any problems of routes nor configuration. Puppy is ready-to-use: you just have to implement your html code.

Puppy uses a simple route system which you can easily extend to add your own behaviour and get more interactivity. For example, you can create a form which will be handled in back-end with Puppy.

Resources
---------

[](#resources)

### Website

[](#website)

### Code

[](#code)

#### Core

[](#core)

- [puppy-application](https://github.com/Raphhh/puppy-application)
- [puppy-config](https://github.com/Raphhh/puppy-config)

#### Modules

[](#modules)

- [puppy-template](https://github.com/Raphhh/puppy-template)
- [puppy-session](https://github.com/Raphhh/puppy-session)
- [puppy-static-route](https://github.com/Raphhh/puppy-static-route)

#### Testing

[](#testing)

- [puppy-client](https://github.com/Raphhh/puppy-client)

About
-----

[](#about)

Puppy is a skeleton that runs Puppy\\Application. It uses Puppy\\Config as config manager.

It includes some default modules:

- [Template module](https://github.com/Raphhh/puppy-template) allows to use Twig as template engine.
- [Static routing module](https://github.com/Raphhh/puppy-static-route) allows to route request uri directly to a template.
- [Session module](https://github.com/Raphhh/puppy-session) helps to manage the session.

Installation
------------

[](#installation)

Use [Composer](http://getcomposer.org/) to download Puppy:

```
$ composer create-project raphhh/puppy path/to/my/project
```

Files architecture
------------------

[](#files-architecture)

```
├── bin
|   ├── build
|   └── run
├── config
|   ├── dev.php
|   ├── global.php
|   └── tets.php
├── public
|   ├── .htaccess
|   ├── index.php
|   └── robots.txt
├── src
├── templates
|   └── public
|       └── index.html.twig
├── tests
├── vars
├── vendor
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .scrutinizer.yml
├── .travis.yml
├── composer.json
├── composer.lock
├── LICENSE
├── phpunit.xml.dist
├── puppy
└── README.md

```

- "bin" contains the executable that you can launch in the console with the command "puppy".
- "config" contains all your config files.
- "public" is the web entry point.
- "src" contains all your PHP code.
- "templates" contains your twig files. It is used by the "static routing" module.
- "tests" contains all your PHP tests. See [PHPUnit](https://phpunit.de/) for more information.
- "vars" is a tmp folder, containing things like cache, ...
- "vendor" contains all your PHP dependencies. See [Composer](https://getcomposer.org/) for more information.

Run the demo
------------

[](#run-the-demo)

### Use the built-in PHP server

[](#use-the-built-in-php-server)

Use the run command in your console:

```
$ puppy run
```

Then, you can launch Puppy in your browser at .

You can also specify you want to run the dev env (no cache).

```
$ puppy run dev
```

### Use any server

[](#use-any-server)

First, you have to know that the public http access to Puppy is the dir '/public'. It is where you will put your css or your js.

If Puppy is not located at the root of your url address, create a local config to define the base url. For example, if you will launch Puppy at '', your local config must be:

```
// config/local.php
