Skip to content
dragoonis edited this page Feb 17, 2012 · 1 revision

The current PPI\App class is quite clean and hosts a "kind of" DI Container already. It lets you set properties against the $app object and then you can fetch those from within your controller.

<?php
$app->session = new \App\MySession();

// Controller
if($this->getSession()->exists($key))

The same will be applied in v2, but we will be calling getService() by default, method such as getSession() can just do return $this->getService('session').

Clone this wiki locally