Skip to content
Devin Smith edited this page Jul 31, 2014 · 19 revisions

Tipsy uses Dependency Injection to allow easy access to services.

Available Services

View

Allows access to the view renderer.

$tipsy->router()
	->when('user/:id', function($View) {
		$View->display('home');
  });

Scope

The scope of the view. All variables are passes by reference to allow two way data binding.

// Router PHP
$tipsy->router()
	->when('chat', function($Scope, $View) {
		$Scope->message = 'Hello!';
		$View->display('chat'); // will output "<b>Hello!</b>"
		echo $Scope->message; // will output "Goodbye!"
  });
// Chat PHTML
<b><?=$message?></b>
<? $message = 'Goodbye!'?>

Tipsy

Direct access to the Tipsy object.

Route

Direct access to the current route

Params

Access to URL params, or JSON post data.

Request

The HTTP request service.

Clone this wiki locally