PHP code example of cenariodev / new-forms-ui

1. Go to this page and download the library: Download cenariodev/new-forms-ui 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/ */

    

cenariodev / new-forms-ui example snippets



CenarioDev\formUI;

// Configure o caminho para os assets
formUI\configure([
    'asset_path' => '/caminho/para/assets'
]);


CenarioDev\formUI;

// Configure os assets
formUI\configure([
    'asset_path' => '/assets'
]);

// Exemplo de formulário básico


formUI\Input([
    'id' => 'nome',
    'placeholder' => 'Digite seu nome',
    'typeValidate' => 'text',
    'typeInput' => 'text',
    'textError' => 'Campo obrigatório',
    'classContainer' => 'custom-container',
    'classContent' => 'custom-content',
    'classInput' => 'custom-input',
    'classIconError' => 'custom-icon',
    'classTextError' => 'custom-error',
    'iconLittleFace' => true
]);


$options = [
    ['label' => 'Opção 1', 'value' => '1', 'status' => false],
    ['label' => 'Opção 2', 'value' => '2', 'status' => false]
];

formUI\Select($options, [
    'id' => 'selecao',
    'colorIcon' => '#000',
    'colorText' => '#000',
    'colorPlaceholder' => '#BCBCBC',
    'textError' => 'Selecione uma opção',
    'classDisplayContainer' => 'custom-container',
    'classSelect' => 'custom-select',
    'classOption' => 'custom-option',
    'classTextError' => 'custom-error',
    'iconLittleFace' => true
]);


formUI\Checkbox([
    'id' => 'termos',
    'label' => 'Aceito os termos de uso',
    'checked' => false,
    'textError' => 'Você precisa aceitar os termos',
    'classTextError' => 'custom-error',
    'iconLittleFace' => true
]);


formUI\RadioRestriction([
    'id' => 'confirmacao',
    'textError' => 'Selecione uma opção',
    'bgColor' => '#fff',
    'color' => '#bcbcbc',
    'bgColorHoverButton' => '#f88430',
    'colorTextHoverButton' => '#fff',
    'borderColor' => 'gray',
    'classContentButton' => 'custom-container',
    'classButton' => 'custom-button',
    'classTextError' => 'custom-error'
]);