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

section() public method

public section ( $message )
    public function section($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
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new SymfonyStyle($input, $output);
     $show_installed = !$input->getOption('available');
     $installed = $available = array();
     foreach ($this->load_migrations() as $name) {
         if ($this->migrator->migration_state($name) !== false) {
             $installed[] = $name;
         } else {
             $available[] = $name;
         }
     }
     if ($show_installed) {
         $io->section($this->user->lang('CLI_MIGRATIONS_INSTALLED'));
         if (!empty($installed)) {
             $io->listing($installed);
         } else {
             $io->text($this->user->lang('CLI_MIGRATIONS_EMPTY'));
             $io->newLine();
         }
     }
     $io->section($this->user->lang('CLI_MIGRATIONS_AVAILABLE'));
     if (!empty($available)) {
         $io->listing($available);
     } else {
         $io->text($this->user->lang('CLI_MIGRATIONS_EMPTY'));
         $io->newLine();
     }
 }
All Usage Examples Of Symfony\Component\Console\Style\SymfonyStyle::section