Get the helper set associated with the command.
public getHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet | ||
return | Symfony\Component\Console\Helper\HelperSet | The HelperSet instance associated with this command |
use Symfony\Component\Console\Helper\Helper; class MyCustomHelper extends Helper { public function getName() { return 'my_custom_helper'; } public function someMethod() { // ... } }
$app = new Symfony\Component\Console\Application(); $helperSet = $app->getHelperSet(); $helperSet->set(new MyCustomHelper());
$app = new Symfony\Component\Console\Application(); $helperSet = $app->getHelperSet(); $tableHelper = $helperSet->get('table'); $tableHelper->setHeaders(['Name', 'Age']); $tableHelper->addRow(['John Doe', 30]); $tableHelper->addRow(['Jane Doe', 25]); $tableHelper->render($output);In this example, we retrieve the `table` helper object, set its headers and data, and render it to the output stream. Overall, the `getHelperSet()` method is a useful utility provided by the `Application` class of the Symfony\Component\Console package library.
public getHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet | ||
return | Symfony\Component\Console\Helper\HelperSet | The HelperSet instance associated with this command |