Gush\Helper\TemplateHelper::getCustomTemplate PHP Метод

getCustomTemplate() публичный Метод

public getCustomTemplate ( $domain ) : null | string
Результат null | string
    public function getCustomTemplate($domain)
    {
        $config = $this->application->getConfig();
        if ('pull-request-create' === $domain && null !== $config && $config->has('table-pr')) {
            return 'custom';
        }
        return;
    }

Usage Example

Пример #1
0
 public function decorateDefinition(ConsoleCommandEvent $event)
 {
     $command = $event->getCommand();
     if (!$command instanceof TemplateFeature) {
         return;
     }
     $names = $this->templateHelper->getNamesForDomain($command->getTemplateDomain());
     $command->addOption('template', 't', InputOption::VALUE_REQUIRED, 'Template to use. <info>One of: ' . implode('</info>, <info>', $names) . '</info>', $this->templateHelper->getCustomTemplate($command->getTemplateDomain()) ?: $command->getTemplateDefault());
 }