<commit_before>FormKit
========

With FormKit library, you can integrate form widgets with your own frameworks,

And of course, you can define your own form widgets for your applications easily.

Tired with HTML forms ? There are some widget layout engines that
can render widget into HTML with HTML table or fieldsets/legends. Of course you can
define your own layout engine too!


For example, to use a text input widget:

```php
<?php

    $text = new FormKit\Widget\TextInput('username', array( 
        'label' => 'Username',
        'placeholder' => '<NAME>',
        'hint'  => 'Please enter 6 characters for your username',
    ));
    $text->value( 'default' )
        ->size(20);

    echo $text; // render 
```

Which outputs:

```html
<input type="text" name="username" value="default" placeholder="<NAME>" size="20"/>
<div class="formkit-hint">Please enter 6 characters for your username</div>
```

SelectInput:

```php
<?php
/* selector with group options */
$countries = new FormKit\Widget\SelectInput( 'country' , array(
    'label' => 'Country',
    'options' => array(
        'Test' => 'Test',
        'Asia' => array( 
            'Taiwan',
            'Taipei',
            'Tainan',
            'Tokyo',
            'Korea',
        )
    )
));
```


Layout
------
To use generic layout:

```php
<?php
$layout = new FormKit\Layout\GenericLayout;
$layout->width(400);
$layout->addWidget( $text )
    ->addWidget( $password )
    ->addWidget( $remember )
    ->addWidget( $birthday )
    ->addWidget( $best_time )
    ->addWidget( $role )
    ->addWidget( $size )
    ->addWidget( $countries )
    ->cellpadding(6)
    ->cellspacing(6)
    ->border(0);
echo $layout;
```


Widget Factory
--------------

Form Widget Factory:

```php
<?php
    use FormKit\FormKit;
    $username = FormKit::text('username');
    $password = FormKit::password('password',array( 
        'class' => 'your-element-class-name',
        'id' =>  'your-element-id',
        'value' => 'default password',
    ));

    echo $username->render();
    echo $password->render();
```




Open Tag & Close Tag
--------------------

```php
    $form = new FormKit\Element\Form(array(
        'class' => 'blah blah'
    ));

    // render elements manully
    echo $form->open();<commit_msg>Add highlight<commit_after>FormKit
========

With FormKit library, you can integrate form widgets with your own frameworks,

And of course, you can define your own form widgets for your applications easily.

Tired with HTML forms ? There are some widget layout engines that
can render widget into HTML with HTML table or fieldsets/legends. Of course you can
define your own layout engine too!


For example, to use a text input widget:

```php
<?php

    $text = new FormKit\Widget\TextInput('username', array( 
        'label' => 'Username',
        'placeholder' => '<NAME>',
        'hint'  => 'Please enter 6 characters for your username',
    ));
    $text->value( 'default' )
        ->size(20);

    echo $text; // render 
```

Which outputs:

```html
<input type="text" name="username" value="default" placeholder="<NAME>" size="20"/>
<div class="formkit-hint">Please enter 6 characters for your username</div>
```

SelectInput:

```php
<?php
/* selector with group options */
$countries = new FormKit\Widget\SelectInput( 'country' , array(
    'label' => 'Country',
    'options' => array(
        'Test' => 'Test',
        'Asia' => array( 
            'Taiwan',
            'Taipei',
            'Tainan',
            'Tokyo',
            'Korea',
        )
    )
));
```


Layout
------
To use generic layout:

```php
<?php
$layout = new FormKit\Layout\GenericLayout;
$layout->width(400);
$layout->addWidget( $text )
    ->addWidget( $password )
    ->addWidget( $remember )
    ->addWidget( $birthday )
    ->addWidget( $best_time )
    ->addWidget( $role )
    ->addWidget( $size )
    ->addWidget( $countries )
    ->cellpadding(6)
    ->cellspacing(6)
    ->border(0);
echo $layout;
```


Widget Factory
--------------

Form Widget Factory:

```php
<?php
    use FormKit\FormKit;
    $username = FormKit::text('username');
    $password = FormKit::password('password',array( 
        'class' => 'your-element-class-name',
        'id' =>  'your-element-id',
        'value' => '<PASSWORD>',
    ));

    echo $username->render();
    echo $password->render();
```




Open Tag & Close Tag
--------------------

```php
<?php
    $form = new FormKit\Element\Form(array(
        'class' => 'blah blah'
    ));

    // render elements manully
    echo $form->open();
{'fraction_non_alphanumeric': 0.1742756804214223, 'fraction_numerical': 0.0052677787532923615, 'mean_word_length': 2.657303370786517, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 70, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3967858', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1375, 'n_words': 408}