Dependency Injection service
Warning. These examples work with the version 2.x of the Jaxon library.
A service which is to be injected in Jaxon classes can first be defined as an interface.
namespace Service;
interface ExampleInterface
{
public function message($isCaps);
public function color($name);
}
Then, there will be a class which implements the interface
namespace Service;
class Example implements ExampleInterface
{
public function message($isCaps)
{
return ($isCaps) ? 'HELLO WORLD!!!!' : 'Hello World!!!!';
}
public function color($name)
{
return $name;
}
}