Skip to content

development input requests

Tim Stair edited this page Mar 18, 2018 · 2 revisions

SAMQ Development: Input Requests

InputRequests group the necessary information to display a prompt to the user. The standard InputRequest consists of text to display and a number of possible Responses.

Standard Usage

Example request from the sample project.

InputRequest::with(
    'After selecting a response the engine transitions to another InputRequest. You chose 1!',
    [
        Response::with('Continue to the map.', 'sample_map_02_04'),
    ]);

The above code will create an InputRequest with the text and array of responses (only 1 response in this case).

Engine Registration

After everything has been configured on an InputRequest it should be added to the engine with the following call: $samqCore->addRequest( specifying the id to link the request to.

Extra Functionality

ConditionalText

In some cases you may need to have text that is displayed based on Conditions. These will render based on the state of the session at the time of rendering.

Adjustments

Adjusments performed before rendering.

Post Adjusments

Adjusments performed after rendering.