AsseticBundle\ServiceFactory::createService PHP Method

createService() public method

public createService ( Zend\ServiceManager\ServiceLocatorInterface $locator ) : Service
$locator Zend\ServiceManager\ServiceLocatorInterface
return Service
    public function createService(ServiceLocatorInterface $locator)
    {
        return $this($locator, 'AsseticService');
    }

Usage Example

Example #1
0
 /**
  * @param ServiceLocatorInterface $serviceLocator
  */
 public function __construct(ServiceLocatorInterface $serviceLocator)
 {
     $serviceFactory = new ServiceFactory();
     $this->service = $serviceFactory->createService($serviceLocator);
     $this->service->build();
     $this->baseUrl = $this->service->getConfiguration()->getBaseUrl();
     $this->basePath = $this->service->getConfiguration()->getBasePath();
 }