description |
---|
<input type="text"> |
namespace PinkCrab\Form_Fields\Fields;
use PinkCrab\Form_Fields\Abstract_Field;
use PinkCrab\Form_Fields\Traits\Placeholder;
use PinkCrab\Form_Fields\Traits\Autocomplete;
class Input_Text extends Abstract_Field {
use Placeholder, Autocomplete;
}
// Useage
Input_Text::create('input_text')->render();
- create( string $key )
- current( mixed $current = null )
- disabled( bool $disabled = true )
- read_only( bool $read_only = true )
- label( string $label )
- class( string $class )
- attribute( string $key, string $value )
- set_attributes( array $attributes )
- show_label( bool $show = true )
- label_position( int $mode = 0 )
- autocomplete( string $autocomplete = 'on' )
- placeholder( string $placeholder = '' )
- get_type()
- get_label()
- get_class()
- get_disabled()
- get_key()
- get_current()
- get_attributes()
- get_autocomplete()
- get_placeholder()
- label_config()
- render()
- as_string()
Input_Text::create( 'basic_text' )->render()
Input_Text::create( 'api_key' )
->label( 'API Key' )
->placeholder( 'Please enter your api key' )
->class( 'my_plugin_admin_field' )
->attribute( 'data-nonce', '76d786d87g6s87d' )
->show_label()
->label_position( Label_Config::BEFORE_INPUT | Label_Config::LINKED_LABEL )
->render();