I am trying to create a simple service in zf2 which I can access using in viewhelper
Step1. I have craeted a class in src/Application/Service/Servic
change the line $this->sm->getServiceLocator()->get('Application\Service\Service1'); in below method
class Abc extends AbstractHelper
{
protected $sm;
public function test()
{
$this->sm->getServiceLocator()->get('Application\Service\Service1');
}
public function __construct($sm) {
$this->sm = $sm;
}
}