Search
 
SCRIPT & CODE EXAMPLE
 

PHP

redaxo mform 7

// init mform
$mform = MForm::factory()

// add fieldset area
    ->addFieldsetArea('Checkbox element', MForm::factory()
        // some checkbox elements
            ->addCheckboxField(1, [1 => 'test-1'], ['label' => 'Checkbox'])
            ->addToggleCheckboxField(3, [1 => 'Toggle test-1'], ['label' => 'Toggle Checkbox'])
    )
// add second fieldset area
    ->addFieldsetArea('Radio buttons element', MForm::factory()
        // radio element
            ->addRadioField(2, [1 => 'test-1', 2 => 'test-2'], ['label' => 'Radio Buttons'])
    )

    ->addFieldsetArea('Fieldset Element', MForm::factory()
        // headline, description and some other elements
            ->addHeadline('MForm Demo Headline')
            ->addDescription('Mform Demo Description for any descriptions texts in your modul input formular.')
            ->addHtml('<b>HTML <i>Text</i></b><br>')
    )
// add second fieldset area
    ->addFieldsetArea('Alert Messages', MForm::factory()
            ->addAlertInfo('Info Alert Message')
            ->addAlertDanger('Danger Alert Message')
            ->addAlertSuccess('Success Alert Message')
            ->addAlertWarning('Warning Alert Message')
            ->addAlertError('Error Alert Message')
    )
// add third fieldset area
    ->addFieldsetArea('', MForm::factory()
        // toogle checkbox with tooltip
            ->addToggleCheckboxField(2, [1 => 'Test-Checkbox'], ['label' => 'Checkbox'])
            ->setTooltipInfo('Tooltip Test-Checkbox Label.', 'fa-question-circle')
    )

    ->addFieldsetArea('Select elements', MForm::factory()
        // some select fields
            ->addSelectField("1.0", [1 => 'test-1', 2 => 'test-2', 3 => 'test-3', 4 => 'test-4'], ['label' => 'Select optgroup'])
            ->addSelectField("1.1", ['group 1' => [1 => 'test-1', 2 => 'test-2'], 'group 2' => [3 => 'test-3', 4 => 'test-4']], ['label' => 'Select optgroup'])
    )

// add fieldset area
    ->addFieldsetArea('Media file elements', MForm::factory()
        // some media fields
        // ->addMedialistField(1, array('label' => 'Image list'))
            ->addImagelistField(1, ['label' => 'Image List'])

    )
// add second fieldset area
    ->addFieldsetArea('Link elements', MForm::factory()
        // some link elements
            ->addLinkField(1, array('label' => 'Link'))
            ->addLinklistField(1, array('label' => 'Link list'))
            ->addCustomLinkField(1, ['label' => 'Custom Link', 'data-intern' => 'enable', 'data-extern' => 'enable', 'data-media' => 'enable', 'data-mailto' => 'enable', 'data-tel' => 'enable'])
            ->addCustomLinkField(5, ['label' => 'Verlinkung Button nur intern oder extern', 'data-media' => 'disable', 'data-mailto' => 'disable', 'widget' => 'disable', 'data-intern' => 'enable', 'data-extern' => 'enable'])
    )

// add fieldset area
    ->addFieldsetArea('Input Text elements', MForm::factory() // init new mform
        // add some text fields
            ->addTextField(1.0, ['label' => 'Input Text'])
            ->addTextField(1.2, ['label' => 'With options and Full width', 'full' => true])
            ->setOptions([1 => 'option1', 2 => 'option2'])
    )
// add second fieldset area
    ->addFieldsetArea('Textarea elements', MForm::factory() // init new mform
            ->addTextAreaField(1.3, ['label' => 'Textarea'])
            ->addTextAreaField(1.4, ['label' => 'Full width'])
            ->addTextAreaField(1.5, ['label' => 'Text CKE5 Editor', 'class' => 'cke5-editor', 'data-lang' => Cke5UtilsCke5Lang::getUserLang(), 'data-profile' => 'default'])
            ->setFull() // or ->addTextAreaField(1.2,['full' => true])
    )
// add third fieldset area
    ->addFieldsetArea('Readonly text elements', MForm::factory() // use mform factory
        // add some readonly text fields
            ->addTextReadOnlyField("2.0", 'string readonly', ['label' => 'Readonly Input Text'])
            ->addTextAreaReadOnlyField(2.1, 'string readonly', ['label' => 'Readonly Textarea'])
    );

// parse form
echo $mform->show();
Comment

PREVIOUS NEXT
Code Example
Php :: twig create new array 
Php :: foreach skip first php 
Php :: Laravel Drop All Tables & Migrate 
Php :: get current logged-in user details in Laravel 
Php :: laravel exists validation query two tables 
Php :: php client enable short tags 
Php :: wp get post thumbnail 
Php :: laravel command progress 
Php :: laravel-admin Model does not exists ! 
Php :: how to delete a file in laravel 
Php :: php get prameter 
Php :: php 7.4 extension sqlite ubuntu 
Php :: php foreach associative array 
Php :: composer deploy production 
Php :: laravel whereraw 
Php :: date 3 months ago for a particular date php 
Php :: is alphanumeric php 
Php :: php check if get var is set 
Php :: code php ajout heure 
Php :: wordpress get permalink in loop 
Php :: laravel vue csrf 
Php :: php convert object to array 
Php :: how to document php api with swagger 
Php :: how get year of field database in laravel collection 
Php :: php chunk array 
Php :: default null migration laravel 
Php :: command to run php file on chrome 
Php :: increase upload limit in phpmyadmin docker 
Php :: in loop how add string by comma in php 
Php :: remove first character from string laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =