From 0bc9424ed2df7fe78e733cb664422f9d1d06f828 Mon Sep 17 00:00:00 2001 From: Ralph Schindler Date: Wed, 2 Nov 2011 12:27:47 -0500 Subject: [PATCH] Edited example 15 with a working workflow against Zend\Di --- example-15.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/example-15.php b/example-15.php index a5ca4d2..506d89a 100644 --- a/example-15.php +++ b/example-15.php @@ -25,8 +25,8 @@ class DriverTwo implements \System\Driver {} 'definition' => array( 'class' => array( 'System\Mapper' => array( - 'addBlock' => array( - 'driver' => array('type' => 'Application\Block', 'required' => true), + 'addDriver' => array( + 'driver' => array('type' => 'System\Driver', 'required' => true), 'name' => array('required' => true) ) ) @@ -35,20 +35,22 @@ class DriverTwo implements \System\Driver {} 'instance' => array( 'System\Mapper' => array( 'injections' => array( - array('block' => 'DifferentNs\DriverOne', 'name' => 'foo'), - array('block' => 'DifferentNs\DriverTwo', 'name' => 'bar') + 'addDriver' => array( + array('driver' => 'DifferentNs\DriverOne', 'name' => 'foo'), + array('driver' => 'DifferentNs\DriverTwo', 'name' => 'bar') + ) ) ) ) ))); - $page = $di->get('System\Mapper'); + $mapper = $di->get('System\Mapper'); // expression to test $works = ( - $page->blocks[0][0] instanceof DifferentNs\DriverOne - && $page->blocks[1][0] instanceof DifferentNs\DriverTwo + $mapper->drivers[0][0] instanceof DifferentNs\DriverOne + && $mapper->drivers[1][0] instanceof DifferentNs\DriverTwo ); - +var_dump($mapper); // display result echo (($works) ? 'It works!' : 'It DOES NOT work!'); }