PHP code example of werx / forms

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

    

werx / forms example snippets


<?=Form::select('color')->data(['Red', 'White', 'Blue'], true)->selected('White')
 php
<?=Form::text('username')
 php
<select name="state">
	<option value="AR" <?=Form::getSelected('state', 'AR')
 php
<?=Form::select('state')->data(['TX' => 'Texas', 'AR' => 'Arkansas', 'OK' => 'Oklahoma'])->label('Choose')
 php
<input type="checkbox" name="pets" value="Cat" <?=Form::getChecked('pets', 'Cat')
 php
<input type="radio" name="color" value="Red" <?=Form::getChecked('color', 'Red')
 php
<?=Form::checkbox('pets')->value('Cat')
 php
<?=Form::radio('color')->value('Red')
 php
<?=Form::radio('color')->value('Red')->checkedWhen($some_value == 'Red')