Visithor\Generator\UrlGenerator::generate PHP Method

generate() public method

Given a configuration array, generates a chain of urls
public generate ( array $config ) : UrlChain
$config array Configuration
return Visithor\Model\UrlChain Chain of URL instances
    public function generate(array $config)
    {
        $defaultHTTPCodes = $this->getDefaultHTTPCodes($config);
        $defaultOptions = $this->getDefaultOptions($config);
        return $this->createUrlChainFromConfig($config, $defaultHTTPCodes, $defaultOptions);
    }

Usage Example

 /**
  * Executes all business logic inside this command
  *
  * This method returns 0 if all executions passed. 1 otherwise.
  *
  * @param OutputInterface $output Output
  * @param array           $config Config
  * @param string          $format Format
  *
  * @return integer Execution return
  */
 protected function executeVisithor(OutputInterface $output, array $config, $format)
 {
     $renderer = $this->rendererFactory->create($format);
     $this->executor->build();
     $urlChain = $this->urlGenerator->generate($config);
     $result = $this->executor->execute($urlChain, $renderer, $output);
     $this->executor->destroy();
     return $result;
 }
All Usage Examples Of Visithor\Generator\UrlGenerator::generate