Book Image

Twilio Cookbook: Second Edition

By : Roger Stringer
Book Image

Twilio Cookbook: Second Edition

By: Roger Stringer

Overview of this book

Table of Contents (20 chapters)
Twilio Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Getting started with PBX


First, let's set up our basic application.

As I previously mentioned, we're building this application using the Jolt micro framework, which is a mini MVC framework that I developed and used for many applications.

I'm going to go over a basic introduction to it so that you can see how it all works and then as we go through each recipe, we'll build on our application until we get a nice, handy system.

You can download the Jolt framework from http://joltframework.com/.

Jolt works in an interesting way; we set it up so that the get and post portions of the site are separated as shown in the following code snippet:

<?php
include 'jolt.php';
$app = new Jolt('my app');
$app->get('/greet', function () use ($app){
    // render a view
    $app->render( 'page', array(
        "pageTitle"=>"Greetings",
        "body"=>"Greetings world!"
    ));
});
$app->post('/greet', function () use ($app){
    // render a view
    $app->render( 'page', array(
        "pageTitle...