Skip to content

Instantly share code, notes, and snippets.

<?php
// outputs a single blank line
$this->io->text('Line 01-01');
$this->io->newLine();
$this->io->text('Line 01-02');
<?php
$this->io->definitionList(
'This is a title',
['foo1' => 'bar1'],
['foo2' => 'bar2'],
['foo3' => 'bar3'],
new \Symfony\Component\Console\Helper\TableSeparator(),
'This is another title',
['foo4' => 'bar4']
);
<?php
$this->io->horizontalTable(
['Header 1', 'Header 2'],
[
['Cell 1-1', 'Cell 1-2'],
['Cell 2-1', 'Cell 2-2'],
['Cell 3-1', 'Cell 3-2'],
]
);
<?php
$this->io->table(
['Header 1', 'Header 2'],
[
['Cell 1-1', 'Cell 1-2'],
['Cell 2-1', 'Cell 2-2'],
['Cell 3-1', 'Cell 3-2'],
]
);
<?php
$this->io->listing([
'Element #1 Lorem ipsum dolor sit amet',
'Element #2 Lorem ipsum dolor sit amet',
'Element #3 Lorem ipsum dolor sit amet',
]);
<?php
$this->io->text('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.');
// with array:
$this->io->text([
'Lorem ipsum dolor sit amet,',
'consectetuer adipiscing elit. Aenean commodo ligula eget dolor.'
]);
<?php
$this->io->section('Neuer Abschnitt');
<?php
$this->io->title('TestTitle');
@eS-IT
eS-IT / TestOutputCommand.php
Last active June 13, 2020 09:29
TestOutputCommand
<?php
namespace Esit\Easyfewo\Classes\Commands;
use Contao\CoreBundle\Framework\ContaoFramework;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
@eS-IT
eS-IT / GreetCommand.php
Created June 13, 2020 09:20
Beispeil für eine Standardausgabe aus dem [Symfony-Handbuch](https://symfony.com/doc/current/console/style.html)
<?php
// src/Command/GreetCommand.php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class GreetCommand extends Command
{