Skip to content

Instantly share code, notes, and snippets.

@yukikaoru
Created July 17, 2013 16:50
Show Gist options
  • Save yukikaoru/6022351 to your computer and use it in GitHub Desktop.
Save yukikaoru/6022351 to your computer and use it in GitHub Desktop.
AppController to use Ray.Di in CakePHP
<?php
use Ray\Di\Injector;
App::uses('Controller', 'Controller');
/**
* Application Controller
*
* Add your application-wide methods in the class below, your controllers
* will inherit them.
*
* @package app.Controller
* @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
*/
class AppController extends Controller
{
/** @var Injector */
private $injector;
public function setInjector(Injector $injector)
{
$this->injector = $injector;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment