Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TemplateHintsEnableCommand.php
Go to the documentation of this file.
1 <?php
8 
9 use Symfony\Component\Console\Command\Command;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
13 
14 class TemplateHintsEnableCommand extends Command
15 {
16 
20  const COMMAND_NAME = 'dev:template-hints:enable';
21 
25  const SUCCESS_MESSAGE = "Template hints enabled.";
26 
30  private $resourceConfig;
31 
37  public function __construct(ConfigInterface $resourceConfig)
38  {
39  parent::__construct();
40  $this->resourceConfig = $resourceConfig;
41  }
42 
46  protected function configure()
47  {
48  $this->setName(self::COMMAND_NAME)
49  ->setDescription('Enable frontend template hints. A cache flush might be required.');
50 
51  parent::configure();
52  }
53 
58  protected function execute(InputInterface $input, OutputInterface $output)
59  {
60  $this->resourceConfig->saveConfig('dev/debug/template_hints_storefront', 1, 'default', 0);
61  $output->writeln("<info>". self::SUCCESS_MESSAGE . "</info>");
62  }
63 }