Skip to content
Devin Smith edited this page Dec 12, 2015 · 5 revisions
1. Include Tipsy

See Installation for more information.

composer require tipsyphp/tipsy
2. Create a new instance of Tipsy
use Tipsy\Tipsy;
$tipsy = new Tipsy;
3. Add a route / page

Routes can be closures, classes, or class instances. Here we create a route using a closure, and assign the internal $Scope and $View properties.

$tipsy->router()
	->when('/', function($Scope, $View) {
		$Scope->user = 'Devin';
		$View->display('home');
	});
4. Create a View

All views are PHTML View Templates. Create a file called home.phtml

<div class="content">
	<h1>Welcome <?=$user?>!</h1>
</div>
5. Start Tipsy

Once you have defined your stuff you can start the process like below.

$tipsy->run();

For more detailed examples see Examples.