Skip to content

Instantly share code, notes, and snippets.

Created Sep 27, 2021
What would you like to do?
Standalone Nette Forms example [cs]
if (@!include __DIR__ . '/../vendor/autoload.php') {
die('Nainstalujte balíčky pomocí `composer require nette/forms`');
use Nette\Forms\Form;
$form = new Form;
$form->addText('name', 'Jméno:')
$form->addPassword('password', 'Heslo:')
$form->addSubmit('send', 'Registrovat');
if ($form->isSuccess()) {
echo 'Formulář byl správně vyplněn a odeslán';
$data = $form->getValues();
// $data->name obsahuje jméno
// $data->password obsahuje heslo
// zpracujeme data a přesměrujeme na jinou stránku
echo '
<!doctype html>
<meta charset="utf-8">
<script src=""></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment