Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

voorhoede/demo-server-silex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo Server Silex

Demo setup of Silex server (PHP) with module structure and demo viewer.

This demo is based on the Silex Skeleton.

  • Templates are moved to src/ following common Voorhoede module setup.
  • Multi-language stub support by adding .{lang}.stub.json files next to view templates.

Module structure

The application is composed out of small single-purpose modules (e.g. app-header, breadcrumb). Each module consists of its own template (module.html) and a demo for variations of this template (module.demo.html). In addition a module can have its own presentation (module.css), behaviour (module.js) and other module files. The modules are grouped into areas (blog, core, gallery, ...). Each area has it's own routes (area/router.js), views (area/*.html) and can have its own assets and other specific files. Finally the entire server is configured in /index.js.

Resulting in the following structure:

src/
    ├── app.php                         <-- Silex app
    ├── controllers.php                 <-- shared routes 
    ├── index.html                      <-- home page template
    |
    └── area-name/                      <-- eg. blog, core, gallery
        ├── area-name.php               <-- routes for this area
        ├── index.html                  <-- area overview template
        ├── item.html                   <-- item template
        |
        └── module-name/
            ├── module-name.html        <-- module template
            ├── module-name.demo.html   <-- demos of template variations
            ├── module-name.(css|js|..) <-- other module specific files
            └── README.md               <-- documentation with instructions
            
web/
    ├── index.php                       <-- front-end controller production
    └── index_dev.php                   <-- front-end controller development

Install

This project requires PHP (>= 5.5.9) and Composer to be installed. Then install dependencies:

composer install

Run

COMPOSER_PROCESS_TIMEOUT=0 composer run

Then, browse to http://localhost:8888/index.php/ (production mode) or http://localhost:8888/index_dev.php/ (development mode).

About

Demo setup of Silex PHP server with module structure and demo viewer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published