Silex Code Fiddles/Examples

silex

For the course Webscripting2 I’m lecturing at ikdoeict.be/KaHo Sint-Lieven, we’re working with Silex. Next to the slidedeck explaining Silex, all examples are freely available on GitHub (links at the bottom of this post)

The collection of examples start with the very basics of Silex and introduce more routing options and services as they continue.

  1. Basic:
    The basic Silex app structure.
  2. Hello:
    The infamous Hello world showcasing the basic Silex app structure, dynamic routing, redirects, and error handlers.
  3. Olleh:
    More routing showcasing requirements, default values, and Route Variable Converters.
  4. Tweets:
    Practical example demonstrating routes using some (static) data.
  5. Tweets Organized:
    Organizes the controllers for the different routes in classes; it’s all about the structure!
  6. Tweets Twig:
    Introduces the built-in TwigServiceProvider, allowing one to use Twig within a Silex app.
  7. Doctrine:
    Introduces the built-in DoctrineServiceProvider, allowing one to use Doctrine’s DBAL within a Silex app.
  8. Doctrine Organized:
    Organizes our codebase a tad better: per entity we introduce a repository which acts as a database layer. Depends on the custom Service Provider knplabs/repository-service-provider (loaded via Composer).
  9. Static Pages:
    Introduces named routes, the UrlGeneratorServiceProvider and a neat little trick to quickly add a few static pages to a project
  10. Middlewares:
    Introduces Middlewares and along with that the MonologServiceProvider
  11. Forms & Validation:
    Introduces the FormServiceProvider and ValidatorServiceProvider

More examples are still in development. The examples are best studied along with the accompanying slides.

Webscripting2 – Serverside Scripting – Silex Code Fiddles →
Webscripting2 – Serverside Scripting – Course Materials →

Note: the course materials are best cloned locally. The fiddles are also included in that repository. Be sure to composer install all examples.

USE-IT Twitter Split-flap Display

Proof of concept of the USE-IT Twitter Split-flap Display, a project issued by USE-IT and built by a few of my students Professional Bachelor ICT

The whole installation is connected via a Netduino board to Twitter and monitors a certain (configurable) hashtag. Tweets found are then displayed on the split-flap display. Heart of the installation is a MCP23018. The split-flaps themselves were recovered from an old train station.

The current installation is only a proof of concept (limited to 8 characters) running in demo mode (showing a set of pre-configured words) and is not optimized yet (characters turn one-by-one, not simultaneously).

Radio Silence

You might have noticed the absence of posts here on bram.us the past week. Culprit were the new lesson materials I have developed for the course Rich Internet Applications (next year to be renamed to Web & Mobile Development)

The developed materials consist of a set of interactive in-browser slide decks, powered by (a customized) Reveal.js and are freely available on GitHub. If you happend to find a bug or have a suggestion, feel free to fork off and send a pull request.

For now, only two slide decks are included in the materials. New slide decks will be added whilst the semester progresses.

RIA Course Materials →

Coin Trail Ghent

Video (in Dutch) about the medieval trade route from Bruges to Cologne, which is being visualized via a coin trail in Ghent, as part of the Portico Project.

A student of the technical university I’m teaching at (KaHo Sint-Lieven Ghent (Ikdoeict)) + myself as guiding lecturer, together with a group of students from Sint-Lucas Visual Arts Ghent (Digital Studio), have participated in the Students’ Challenge of the Portico project.

Here’s the presentation, along with a demo of the resulting game/app, we gave back in May (English) in Cologne: