Skip to content

Instantly share code, notes, and snippets.

@MihailoJoksimovic
Created October 31, 2012 14:16
Show Gist options
  • Save MihailoJoksimovic/3987257 to your computer and use it in GitHub Desktop.
Save MihailoJoksimovic/3987257 to your computer and use it in GitHub Desktop.
dig@dev:/data1/www/catdevng.office.dig/ssl-htdocs/catdev/mj/trunk$ php mixa_test.php
<?php
return array (
'factories' =>
array (
'Test' => 'function ($serviceManager) {
$form = new SomeModule\\Form\\User();
// Retrieve a dependency from the service manager and inject it!
$form->setInputFilter($serviceManager->get(\'UserInputFilter\'));
return $form;
}
',
),
);
$xml =<<<'XML'
<service_manager>
<factories>
<Test>function ($serviceManager) {
$form = new SomeModule\Form\User();
// Retrieve a dependency from the service manager and inject it!
$form->setInputFilter($serviceManager->get('UserInputFilter'));
return $form;
}
</Test>
</factories>
</service_manager>
XML;
$reader = new Zend\Config\Reader\Xml();
$config = new Zend\Config\Config($reader->fromString($xml));
$writer = new Zend\Config\Writer\PhpArray();
echo $writer->toString($config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment