当前位置: 首页>>代码示例>>PHP>>正文


PHP DrupalStyle::section方法代码示例

本文整理汇总了PHP中Drupal\Console\Style\DrupalStyle::section方法的典型用法代码示例。如果您正苦于以下问题:PHP DrupalStyle::section方法的具体用法?PHP DrupalStyle::section怎么用?PHP DrupalStyle::section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Console\Style\DrupalStyle的用法示例。


在下文中一共展示了DrupalStyle::section方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
 }
开发者ID:shaktik,项目名称:DrupalConsole,代码行数:30,代码来源:AboutCommand.php

示例2: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new DrupalStyle($input, $output);
     $module_handler = $this->getModuleHandler();
     $io->section($this->trans('commands.cron.debug.messages.module-list'));
     $io->table([$this->trans('commands.cron.debug.messages.module')], $module_handler->getImplementations('cron'), 'compact');
 }
开发者ID:eleaga,项目名称:DrupalConsole,代码行数:7,代码来源:DebugCommand.php

示例3: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new DrupalStyle($input, $output);
     $io->section($this->trans('commands.event.debug.messages.event-list'));
     $tableHeader = [$this->trans('commands.event.debug.messages.events')];
     $tableRows = $this->getEvents();
     $io->table($tableHeader, $tableRows, 'compact');
 }
开发者ID:void--,项目名称:DrupalConsole,代码行数:11,代码来源:EventDebugCommand.php

示例4: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output = new DrupalStyle($input, $output);
     $table = new Table($output);
     $table->setStyle('compact');
     $module_handler = $this->getModuleHandler();
     $output->section($this->trans('commands.cron.debug.messages.module-list'));
     $table->setHeaders([$this->trans('commands.cron.debug.messages.module')]);
     foreach ($module_handler->getImplementations('cron') as $module) {
         $table->addRow([$module]);
     }
     $table->render();
 }
开发者ID:legovaer,项目名称:DrupalConsole,代码行数:13,代码来源:DebugCommand.php

示例5: 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();
 }
开发者ID:dustinleblanc,项目名称:DrupalConsole,代码行数:21,代码来源:AboutCommand.php


注:本文中的Drupal\Console\Style\DrupalStyle::section方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。