sdl3/examples/Todo.php
2025-10-22 18:44:38 +02:00

30 lines
948 B
PHP

<?php
use PHPNative\Ui\Widget\Label;
require_once __DIR__ . '/../vendor/autoload.php';
// Check PHP version
if (PHP_VERSION_ID < 80100) {
die("This demo requires PHP 8.1+ for Fiber support.\nYour version: " . PHP_VERSION . "\n");
}
$app = new \PHPNative\Framework\Application('ToDo Demo', 700, 500);
$container = new \PHPNative\Ui\Widget\Container(style: 'm-10 p-10 flex-row rounded-xl bg-lime-200');
$containerContent = new \PHPNative\Ui\Widget\Container(style: 'flex-1 bg-lime-700');
$labelContent = new Label(
text: 'Todo App',
style: 'text-xl2 text-red-500',
);
$containerContent->addComponent($labelContent);
$container->addComponent($containerContent);
$containerMenu = new \PHPNative\Ui\Widget\Container(style: 'w-200 bg-lime-200');
$label = new Label(
text: 'Menu App',
style: 'text-red-500',
);
$containerMenu->addComponent($label);
$container->addComponent($containerMenu);
$app->setRoot($container);
$app->run();