Symfony\Component\Console\Style\SymfonyStyle::title PHP Method

title() public method

public title ( $message )
    public function title($message)
    {
        $this->autoPrependBlock();
        $this->writeln(array(
            sprintf('<comment>%s</>', OutputFormatter::escapeTrailingBackslash($message)),
            sprintf('<comment>%s</>', str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message))),
        ));
        $this->newLine();
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new SymfonyStyle($input, $output);
     $name = $input->getArgument('name');
     if (empty($name)) {
         $io->comment('Provide the name of a bundle as the first argument of this command to dump its configuration.');
         $io->newLine();
         $this->listBundles($output);
         return;
     }
     $extension = $this->findExtension($name);
     $container = $this->compileContainer();
     $configs = $container->getExtensionConfig($extension->getAlias());
     $configuration = $extension->getConfiguration($configs, $container);
     $this->validateConfiguration($extension, $configuration);
     $configs = $container->getParameterBag()->resolveValue($configs);
     $processor = new Processor();
     $config = $processor->processConfiguration($configuration, $configs);
     if ($name === $extension->getAlias()) {
         $io->title(sprintf('Current configuration for extension with alias "%s"', $name));
     } else {
         $io->title(sprintf('Current configuration for "%s"', $name));
     }
     $io->writeln(Yaml::dump(array($extension->getAlias() => $config), 3));
 }
All Usage Examples Of Symfony\Component\Console\Style\SymfonyStyle::title