protected function execute(InputInterface $input, OutputInterface $output) { $componentName = $input->getArgument('component'); $component = new BitrixComponent($componentName); if (!$component->exists()) { $output->writeln("<error>Component {$componentName} not found </error>"); return 1; } $showFullPath = $input->getOption('full-path'); $showLocation = $input->getOption('show-location'); if ($input->getOption('default')) { $templates = $component->getDefaultTemplates($showFullPath); } else { if ($input->getOption('bitrix')) { $templates = $component->getSiteTemplates('bitrix', $showFullPath, $showLocation); } else { if ($input->getOption('local')) { $templates = $component->getSiteTemplates('local', $showFullPath, $showLocation); } else { $templates = array_merge($component->getDefaultTemplates($showFullPath), $component->getSiteTemplates('bitrix', $showFullPath, $showLocation), $component->getSiteTemplates('local', $showFullPath, $showLocation)); } } } foreach ($templates as $template) { $output->writeln("<info>{$template}</info>"); } }