extensionManager = $extensionManager; parent::__construct(); } protected function configure() { $this ->setName('theme:path') ->setDescription($this->trans('commands.theme.path.description')) ->addArgument( 'theme', InputArgument::REQUIRED, $this->trans('commands.theme.path.arguments.module') ) ->addOption( 'absolute', '', InputOption::VALUE_NONE, $this->trans('commands.theme.path.options.absolute') ); } protected function execute(InputInterface $input, OutputInterface $output) { $io = new DrupalStyle($input, $output); $theme = $input->getArgument('theme'); $fullPath = $input->getOption('absolute'); $theme = $this->extensionManager->getTheme($theme); $io->info( $theme->getPath($fullPath) ); } /** * {@inheritdoc} */ protected function interact(InputInterface $input, OutputInterface $output) { $io = new DrupalStyle($input, $output); // --module argument $theme = $input->getArgument('theme'); if (!$theme) { // @see Drupal\Console\Command\Shared\ModuleTrait::moduleQuestion $module = $this->moduleQuestion($io); $input->setArgument('theme', $module); } } }