1. Go to this page and download the library: Download sunnyflail/forms 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/ */
sunnyflail / forms example snippets
use SunnyFlail\Forms\Form\FormElement;
use SunnyFlail\Forms\Interfaces\IFormBuilder;
class ConcreteForm extends FormElement
{
public function build(IFormBuilder $builder)
{
(...)
}
}
$builder->add(new InputField('text'));
$objectCreator = new SunnyFlail\ObjectCreator\ObjectCreator();
$valueMapper = new SunnyFlail\Forms\Mappers\ValueMapper($objectCreator);
$valueProviderFactory = new SunnyFlail\Forms\Providers\ProviderFactory();
$builder = new SunnyFlail\Forms\Form\FormBuilder($valueMapper, $valueProviderFactory);