commit 147e3ba5f6dd4d4c236253130aec432b87da5931 Author: Thomas Peterson Date: Tue Sep 17 21:35:27 2024 +0200 First Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3180570 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.cache/ +.idea/ +build/ +vendor/ +composer.lock diff --git a/app/App.php b/app/App.php new file mode 100644 index 0000000..8b1fcac --- /dev/null +++ b/app/App.php @@ -0,0 +1,18 @@ +style = "bg-white p-6"; + + $this->testButton = new TestButton(label: "Exit"); + $this->test1Button = new TestButton(label: "Login"); + } + + public function getView(): View + { + return new MainLayout([ + $this->test1Button, + $this->testButton + ]); + } +} \ No newline at end of file diff --git a/app/Windows/MainWindow.php b/app/Windows/MainWindow.php new file mode 100644 index 0000000..83236c8 --- /dev/null +++ b/app/Windows/MainWindow.php @@ -0,0 +1,28 @@ +mainView->testButton->setOnClick(function () use ($mainView) { + echo $this->mainView->testButton->label; + }); + } + + public function getView(): View + { + return $this->mainView; + } + + public function getTitle(): string + { + return "DEMO APP"; + } +} \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..98a9927 --- /dev/null +++ b/composer.json @@ -0,0 +1,26 @@ +{ + "name": "phpnative/app", + "type": "project", + "license": "MIT", + "require": { + "phpnative/framework": "@dev" + }, + "autoload": { + "psr-4": { + "App\\": "app/" + } + }, + "repositories": [ + { + "type": "path", + "url": "../framework" + } + ], + "authors": [ + { + "name": "Thomas Peterson", + "email": "info@thomas-peterson.de" + } + ], + "minimum-stability": "dev" +} diff --git a/phpnative b/phpnative new file mode 100755 index 0000000..8cf9c74 --- /dev/null +++ b/phpnative @@ -0,0 +1,14 @@ +#!/usr/bin/env php +run(\App\Windows\MainWindow::class); + +exit;