Skip to content
Everett Griffiths edited this page May 20, 2014 · 1 revision

Text

Syntax: text(string $name, string $default='',array $args=array(),string $tpl=null)

  • $name string the name of the field (required)
  • $default string the default value for the field. This will get overridden by setValues(). (optional)
  • $args array any additional arguments to pass to the field. (optional)
  • $tpl string formatting string.

Examples

<?php print \Formbuilder\Form::text('first_name'); ?>

Set a default value:

<?php print \Formbuilder\Form::text('first_name', 'Bob'); ?> 

Set other parameters via the $args array:

<?php 
print \Formbuilder\Form::text('first_name', 'Bob', 
    array('label'=>'First Name','description'=>'Your given name','class'=>'important')
); 
?> 
Clone this wiki locally