PHP code example of eftec / formone

1. Go to this page and download the library: Download eftec/formone 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/ */

    

eftec / formone example snippets



$f=new \eftec\FormOne();

echo $f->start();
echo $f->id('field1')
    ->label('field 1:')
    ->type('label')
    ->render();
echo $f->id('field1')
    ->type('text')
    ->render();
echo $f->renderRaw('<br>');
echo $f->end();

$form
    ->addClass("col-sm-2 col-form-label")

$form
    ->addClass("col-sm-2")
    ->addClass("col-form-label")

$f->classType('label','col-sm-2 col-form-label'); // for all labels
$f->classType('text','col-sm-10 form-control'); // for all textbox
$f->classType('select','col-sm-10 form-control'); // for all select

$form->addItem('','--select a field--')

$form->addItem(['id'=>'','text'=>'--select a field--'])

$array=[
            ['id'=>1,'text'=>'America'],
            ['id'=>2,'text'=>'Asia'],
            ['id'=>3,'text'=>'Europa'],
        ];
$form->addItem($array)

$form->type('label')
    ->id('id')
    ->addClass("col-sm-2 col-form-label")
    ->inner('Id 1:')
    ->render()