Thorm
Get started
Get Started in 5 minutes
First Page
Your first page
The controller
Header
Hero section
Contact section
The API
Considerations
Docs
Overview
Guides
Intro
Atoms
Node builders
Props helpers
State + expressions
Expression builder
Events + actions
Effects + targets
API
Api
Examples
Roadmap
Blog
Community
Get Started
GitHub
Bid
Submit bid amounts over HTTP and render response feedback reactively.
Place bid
PHP
📄 Copy code
<?php $amount = state(10); $status = state(0); $out = state(''); $app = el('div', [ cls('container'), ], [ el('h1',[], [ text('Bid example') ]), el('form', [ cls('my-5'), on('submit', http( val('/api/bid/'), 'POST', $out, $status, ['Content-Type' => 'application/x-www-form-urlencoded'], concat('amount=', read($amount)), 'json' ) ) ], [ el('div', [ cls('col col-lg-2')], [ el('input', [ cls('form-control shadow col-3'), attrs(['type'=>'number']), ...bind($amount, ['type'=>'number']) ] ), ] ), el('button', [ cls('btn btn-primary mt-3') ], [ text('Place bid') ]), el('p', [], [ text(get(read($out), 'message')) ]), el('p', [], [ text( cond( get(read($out), 'ok'), 'Thanks!', get(get(read($out), 'error'), 'message') ) ) ]) ]) ]);