sdl3/examples/Todo.php
2025-10-22 18:24:50 +02:00

23 lines
676 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 rounded-xl bg-lime-200');
$containerMenu = new \PHPNative\Ui\Widget\Container(style: 'bg-lime-700');
$label = new Label(
text: 'Todo App',
style: 'text-xl2 text-red-500',
);
$containerMenu->addComponent($label);
$container->addComponent($containerMenu);
$app->setRoot($container);
$app->run();