PHP code example of shadowprince / forman

1. Go to this page and download the library: Download shadowprince/forman library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shadowprince / forman example snippets


$form = new \Forman\Form(
    new \Forman\Field\Value("email"),
    new \Forman\Field\Text("text"),
    (new \Forman\Field\Checkbox("subscr"))->setValue(1)
);

if ($data = $form->process($_POST)) {
    // send email
}

render_template("contact.html", array(
    "form" => $form->getRenderer("\Forman\Render\HTML\Renderer")
        ->setAction("/contact")
        ->GET(),
));