public function createService(ServiceLocatorInterface $viewHelperManager)
    {
        $serviceLocator = $viewHelperManager->getServiceLocator();
        $config = $serviceLocator->has('config') ? $serviceLocator->get('config') : array();
        if (isset($config['dojo'])) {
            $this->config($config['dojo']);
        }
        
        $application = $serviceLocator->get('application');
        $debug = $application->getRequest()->getQuery('debug'); 
        if ($debug !== null) {
            $this->setDebug($debug == 'true');
        }
        
        return $this;
    }