PHP code example of mvccore / ext-form-field-numeric

1. Go to this page and download the library: Download mvccore/ext-form-field-numeric 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/ */

    

mvccore / ext-form-field-numeric example snippets


$form = (new \MvcCore\Ext\Form($controller))->SetId('demo');
...
$yourAge = new \MvcCore\Ext\Forms\Fields\Number();
$yourAge
	->SetName('your_age')
	->SetLabel('Your Age')
	->SetMin(0)
	->SetMax(130)
	->SetStep(1)
	->SetValidators('Integer');
$schoolAge = new \MvcCore\Ext\Forms\Fields\Range([
	'name'		=> 'school_age',
	'label'		=> 'Your school age from/to',
	'min'		=> 0,
	'max'		=> 130,
	'step'		=> 1,
	'validators'	=> ['Range'],
]);
...
$form->AddFields($yourAge, $schoolAge);