

Once you’ve installed Drupal Console, you need to run it inside the folder of your Drupal site. Make it executable: chmod +x /usr/local/bin/drupal Module Command Move it to your local bin, so that it can be used anywhere on your system: mv drupal.phar /usr/local/bin/drupal

#DRUPAL CONSOLE INSTALL#
To install Drupal Console, you need to run three commands: curl -L -o drupal.phar
#DRUPAL CONSOLE HOW TO#
So without further ado, let’s find out how to easily create Drupal 8 modules.
#DRUPAL CONSOLE CODE#
Well, the former can be used to generate boilerplate code out of the box, which is a huge benefit considering the OOP aspect of Drupal 8. In case you’re wondering why use Drupal Console when we already have Drush. Drupal Console is a tool built around the symfony framework and follows the OOP methodology. More importantly, there is a notable difference when you create your own modules.Īlthough creating modules in Drupal 8 is a complex task, it can be made easy through a magnificent CLI tool for Drupal, called the Drupal Console. #8 /app/vendor/drupal/console/bin/drupal(4): require('/app/vendor/dru.')Įrror: Call to undefined method Drupal\metatag\Command\GenerateTagCommand::getIo() in Drupal\metatag\Command\GenerateTagCommand->moduleQuestion() (line 46 of /app/vendor/drupal/console/src/Command/Shared/ModuleTrait.php).Īny idea what might be the issue? I've scoured the issue queue.Follow don’t have to be an expert to know that the Drupal 8 module contains drastic modifications when compared to its predecessor. #7 /app/vendor/drupal/console/bin/drupal.php(89): Symfony\Component\Console\Application->run() #6 /app/vendor/symfony/console/Application.php(148): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #5 /app/vendor/drupal/console/src/Application.php(64): Drupal\Console\Core\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #4 /app/vendor/drupal/console-core/src/Application.php(185): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #3 /app/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Drupal\metatag\Command\GenerateTagCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #2 /app/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #1 /app/vendor/symfony/console/Command/Command.php(236): Drupal\metatag\Command\GenerateTagCommand->interact(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) I am getting an error:Įrror: Call to undefined method Drupal\metatag\Command\GenerateTagCommand::getIo() in /app/vendor/drupal/console/src/Command/Shared/ModuleTrait.php on line 46 #0 /app/web/modules/contrib/metatag/src/Command/GenerateTagCommand.php(189): Drupal\metatag\Command\GenerateTagCommand->moduleQuestion(Object(Drupal\Console\Core\Style\DrupalStyle)) I'm trying to use Drupal Console to generate custom metatags.
