swytch framework
Hotfix: caching
Swytchフレームワークは、APIエンドポイントを含むアプリケーションロジックとインラインでHTMLを書くことができる、新しい、駆け出しの強力なフレームワークです。 HTMLを処理して脱出するために、ブラウザサイドのヘビーリフティングとカスタムストリーミングHTML5パーサー用のHTMXの上に構築されています。
特徴:
注:これは現在、プリプロダクションソフトウェアであり、生産の使用にはお勧めしません。
以下は、Swytchフレームワークを使用したアプリの例です。
ライブでライブでチェックしてください。getswytch.com。これは秘密のメッセージアプリです。
このアプリは、パスワードに電子メールを送信することにより、シンプルな認証システムを提供します。 Kubernetes Ingress Authenticationを提供します。
#[ Bottledcode SwytchFramework Template Attributes Component( ' example ' )]
class ExampleComponent {
use Bottledcode SwytchFramework Template Traits RegularPHP;
use Bottledcode SwytchFramework Template Traits Htmx;
#[ Bottledcode SwytchFramework Router Attributes Route( Bottledcode SwytchFramework Router Method:: POST , ' /api/number ' )]
public function getNumber ( string $ name , string $ number ): int {
return $ this -> render ( $ name , random_int ( 0 , 100 ));
}
public function render ( string $ name , int $ number = null ): string {
$ this -> begin ();
?>
<div>
<h1>Hello, { <?= $ name ?> }</h1>
<form hx-post="/api/number">
<!-- CSRF protection is automatically added to forms -->
<input type='hidden' name='name' value={ <?= $ name ?> } />
<p>Here is a random number: { <?= $ number ?> }</p>
<button type="submit">Generate a new random number</button>
</form>
</div>
<?php
return $ this -> end ();
}
}