use Widget\Input; $input = new Input('text'); echo $input;
use Widget\Input; $input = new Input('password'); $input->setLabel('Password'); echo $input;
use Widget\Input; $input = new Input('file'); $input->setLabel('Upload a file'); $input->setValidator(function($value){ if(!is_uploaded_file($value['tmp_name'])){ return 'Please select a file to upload'; } }); echo $input;The above code will generate an HTML label tag and an input tag of type "file" with a label "Upload a file". It also has a validation function that checks if a file was uploaded or not. Package Library: Widget