-
Notifications
You must be signed in to change notification settings - Fork 4
BasicApplication
jdp edited this page Sep 13, 2010
·
1 revision
To create an application is to superclass the Tessera
class. An extremely simple application could be built like this:
require 'tessera.php';
class BasicApp extends Tessera {
function index() {
echo "Deep down, deep down, dadi dadu dadu dadi dada";
}
}
$basic = new BasicApp(array(
'/' => 'index'
));
For the rest of this writeup, assume that this file is saved as basic.php on your domain, tesseratic.com.
The BasicApp
class superclasses the Tessera
class, and in its constructor it provides routes that map to methods inside the BasicApp
class. In the code, the / route maps to the BasicApp::index
method. When that route is matched by a request, the method is called. Its output (if any) is buffered, and so are any associated views and layouts.