u/AlexDrevOps

PHPTUI - Terminal user interfaces for PHP
▲ 0 r/PHP

PHPTUI - Terminal user interfaces for PHP

Every feature has a reference page and a runnable, self-contained example in playground/:

  • 🧩 16 fields
  • 🔀 Conditional fields
  • 🏗️ Builder-driven
  • 🗺️ Full-screen and multi-column layouts
  • 🎛️ Interactive or unattended
  • 🎨 Themes and dark/light modes
  • ⌨️ Key bindings
  • 🌍 Translations
  • 🧪 Test harness for your project

​

use DrevOps\PhpTui\Builder\Form;
use DrevOps\PhpTui\Builder\PanelBuilder;
use DrevOps\PhpTui\Tui;

$form = Form::create('Quick start')
  ->panel('order', 'New order', function (PanelBuilder $p): void {
    $p->text('name', 'Order name')->required();
    $p->select('fruit', 'Fruit')->default('banana')->options([
      'apple' => 'Apple',
      'banana' => 'Banana',
      'cherry' => 'Cherry',
    ]);
    $p->select('veg', 'Vegetables')->multiple()->default(['carrot'])->options([
      'carrot' => 'Carrot',
      'tomato' => 'Tomato',
      'spinach' => 'Spinach',
    ]);
    $p->number('quantity', 'Quantity')->min(1)->max(99)->default(6);
    $p->confirm('organic', 'Organic only?')->default(FALSE);
  });

// Interactive on a terminal, non-interactive otherwise. 
$answers = (new Tui($form))->run();
phptui.dev
u/AlexDrevOps — 7 days ago
▲ 12 r/drupal

Drupal Extension Scaffold - Template for a contributed Drupal module or theme with CI and mirroring to Drupal.org

For when you want to develop a module or theme on GitHub, test it using GitHub Actions or CircleCI, and push the code to Drupal.org.

github.com
u/AlexDrevOps — 3 months ago