PHP code example of slick / form
1. Go to this page and download the library: Download slick/form 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/ */
slick / form example snippets
use Slick\Form\FormRegistry;
class LoginController
{
public function login()
{
$form = FormRegistry::getForm('login-form.yml');
return compact('form');
}
}
use Slick\Form\FormRegistry;
class LoginController
{
public function login()
{
$form = FormRegistry::getForm('login-form.yml');
if ($form->wasSubmitted()) {
if ($form->isValid()) {
$data = $form->getValues(); // An associative array with submitted values
// Do stuff with the values
} else {
// data is not valid
}
}
return compact('form');
}
}