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

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


$form = (new \MvcCore\Ext\Form($controller))->SetId('job_hunting');
...
$jobQual = new \MvcCore\Ext\Forms\Fields\Select;
$jobQual
	->SetName('job_qualification')
	->SetLabel('Job Qualificatio:')
	->SetOptions([
		'junior'	=> 'Junior Developer',
		'senior'	=> 'Senior developer',
		'manager'	=> 'IT Manager',
	]);
$gender = new \MvcCore\Ext\Forms\Fields\Radio([
	'name'		=> 'gender',
	'label'		=> 'Gender:',
	'options'	=> [
		'M'			=> 'Male',
		'F'			=> 'Female',
		'O'			=> 'Other',
	],
]);
$country = new \MvcCore\Ext\Forms\Fields\CountrySelect([
	'name'		=> 'country',
	'label'		=> 'Country:',
	'filter'	=> ['DE', 'AT', 'FR', 'NL'],
]);
$skills = new \MvcCore\Ext\Forms\Fields\CheckboxGroup([
	'name'		=> 'skills',
	'label'		=> 'I control programming languages:',
	'options'	=> [
		'html'		=> 'HTML5',
		'css'		=> 'CSS3',
		'js'		=> 'Javascript',
		'ts'		=> 'Typescript',
		'php'		=> 'PHP',
		'cs'		=> 'C#',
		'vb'		=> 'Visual Basic',
		'java'		=> 'Java',
		'py'		=> 'Python',
		'pl'		=> 'Perl',
	],
]);
$public = new \MvcCore\Ext\Forms\Fields\Checkbox([
	'name'		=> 'public',
	'label'		=> 'Yes, anybody could see my profile.',
	'checked'	=> TRUE,
]);
$color = new \MvcCore\Ext\Forms\Fields\Color([
	'name'		=> 'profile_color',
	'label'		=> 'My profile color:',
	'value'		=> '#0000FF',
]);

...
$form->AddFields($jobQual, $gender, $country, $skills, $public, $color);