App params

Your apps can have 'routing params'.

Consider a chat room which has multiple rooms, where you don't want to have to define the rooms in advance.

Setup

Add an app with a route param.

Auto discovery

The filename should be chat-[room].php

Array

The key should be chat-{room}.php

String

Unsupported, as this app will be the 'default' app.

Accessing the 'room' value

Room will now be made available as the first argument to your app ($argv[1]), and in the environment variable WHISP_PARAM_ROOM.

You can use multiple params if needed. They'll always be strings.