本文整理匯總了PHP中Drupal\Console\Style\DrupalStyle::setDecorated方法的典型用法代碼示例。如果您正苦於以下問題:PHP DrupalStyle::setDecorated方法的具體用法?PHP DrupalStyle::setDecorated怎麽用?PHP DrupalStyle::setDecorated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Console\Style\DrupalStyle
的用法示例。
在下文中一共展示了DrupalStyle::setDecorated方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new DrupalStyle($input, $output);
$application = $this->getApplication();
$drupal = $this->getDrupalHelper();
// Provide drupal version if it's installed
$drupalVersion = $this->trans('commands.site.status.messages.not_installed');
if ($drupal->isInstalled()) {
$drupalVersion = sprintf($this->trans('commands.site.status.messages.current_version'), $this->getSite()->getDrupalVersion());
}
$aboutTitle = sprintf('%s (%s) | Supports Drupal (%s) | %s', $this->trans('commands.site.status.messages.console'), $application->getVersion(), $application::DRUPAL_SUPPORTED_VERSION, $drupalVersion);
$io->setDecorated(false);
$io->title($aboutTitle);
$io->setDecorated(true);
$commands = ['init' => [$this->trans('commands.init.description'), 'drupal init --override'], 'quick-start' => [$this->trans('commands.common.messages.quick-start'), 'drupal chain --file=~/.console/chain/quick-start.yml'], 'site-new' => [$this->trans('commands.site.new.description'), sprintf('drupal site:new drupal8.dev %s', $application::DRUPAL_SUPPORTED_VERSION)], 'site-install' => [$this->trans('commands.site.install.description'), sprintf('drupal site:install')], 'links' => [$this->trans('commands.list.description'), 'drupal list']];
foreach ($commands as $command => $commandInfo) {
$io->writeln($commandInfo[0]);
$io->newLine();
$io->comment(sprintf(' %s', $commandInfo[1]));
$io->newLine();
}
$io->setDecorated(false);
$io->section($this->trans('commands.self-update.description'));
$io->setDecorated(true);
$io->comment(' drupal self-update');
$io->newLine();
}
示例2: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$output = new DrupalStyle($input, $output);
$application = $this->getApplication();
$aboutTitle = sprintf('%s (%s) | Supports Drupal %s', $this->trans('commands.site.status.messages.console'), $application->getVersion(), $application::DRUPAL_VERSION);
$output->setDecorated(false);
$output->title($aboutTitle);
$output->setDecorated(true);
$commands = ['init' => [$this->trans('commands.init.description'), 'drupal init [--override]'], 'quick-start' => [$this->trans('commands.common.messages.quick-start'), 'drupal chain --file=~/.console/chain/quick-start.yml'], 'site-new' => [$this->trans('commands.site.new.description'), sprintf('drupal site:new drupal8.dev %s', $application::DRUPAL_VERSION)], 'site-install' => [$this->trans('commands.site.install.description'), sprintf('drupal site:install')], 'links' => [$this->trans('commands.list.description'), 'drupal list']];
foreach ($commands as $command => $commandInfo) {
$output->writeln($commandInfo[0]);
$output->newLine();
$output->writeln(sprintf(' <comment>%s</comment>', $commandInfo[1]));
$output->newLine();
}
$output->setDecorated(false);
$output->section($this->trans('commands.self-update.description'));
$output->setDecorated(true);
$output->writeln(' <comment>drupal self-update</comment>');
$output->newLine();
}