2017 © Pedro Peláez
 

olympus-field olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Zeus Core framework.

image

getolympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Zeus Core framework.

  • Tuesday, May 1, 2018
  • by crewstyle
  • Repository
  • 1 Watchers
  • 0 Stars
  • 180 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

, (*1)

Dionysos Text Field

Olympus Component ![CodeFactor Grade][codefactor-image] Packagist Version ![MIT][license-image], (*2)

This component is a part of the Olympus Dionysos fields for WordPress.
It uses the default WordPress text field to display password, range, text, datetime, tel, and more fields., (*3)

composer require getolympus/olympus-dionysos-field-text

Table of contents

Field initializationVariables definitionSettings definitionRetrive dataRelease HistoryContributing, (*4)


Field initialization

Use the following lines to add a text field in your WordPress admin pages or custom post type meta fields:, (*5)

return \GetOlympus\Dionysos\Field\Text::build('my_text_field_id', [
    'title'       => 'What do you like?',
    'default'     => 'Penguins, I am sure they\'re gonna dominate the World!',
    'description' => 'Put in here everything you want.',
    'placeholder' => 'McDonald\'s as well',
    'type'        => 'text',

    /**
     * Settings definition
     * @see the `Settings definition` section below
     */
    'settings' => [],
]);

Variables definition

Variable Type Default value if not set Accepted values
title String 'Text' empty
default String empty empty
description String empty empty
placeholder String empty empty
type String 'text' see Accepted type
settings Array see Field initialization see Settings definition

Accepted type

Settings definition

The settings variable is an array of options depending on type value.
In all cases, here are the default settings with their explanations:, (*6)

Variable Type Default value if not set Accepted values
attrs String empty empty
after String empty empty
before String empty empty
class String empty empty
readonly Boolean false true or false
  • Special case: attrs will let you add all additional attributes you need, such as data-*. Pay attention to this!
  • after will insert contents after the field. In number and range cases, the after content will prepend the max value
  • before will insert contents before the field. In number and range cases, the before content will append the min value
  • class will add CSS classes to the already-in regular-text field class (not used in hidden case)
  • readonly will avoid the field to be used when its value is set to true

Date type

Full documentation on Mozilla Date page, (*7)

Variable Type Default value if not set Accepted values
max Date empty latest date to accept in yyyy-MM-dd format
min Date empty earliest date to accept in yyyy-MM-dd format
step Integer empty integer, to read as day

Datetime-local type

Full documentation on Mozilla Datetime-local page, (*8)

Variable Type Default value if not set Accepted values
max Date empty latest date to accept in yyyy-MM-ddThh:mm format
min Date empty earliest date to accept in yyyy-MM-ddThh:mm format
step Integer empty integer, to read as second

Email type

Full documentation on Mozilla Email page, (*9)

Variable Type Default value if not set Accepted values
maxlength Integer empty empty
minlength Integer empty empty
multiple Boolean false true or false
pattern String empty javascript regular expression
size Integer empty empty
spellcheck Boolean false true or false

Hidden type

Full documentation on Mozilla Hidden page, (*10)

Variable Type Default value if not set Accepted values
display Boolean false true or false

This special display variable defines if the hidden field have to show field value or not: - set to false, a sentence will show where the value is stored in Database - set to true, a sentence will show where the value is stored in Database and what is the current value, (*11)

Month type

Full documentation on Mozilla Month page, (*12)

Variable Type Default value if not set Accepted values
max Date empty latest date to accept in yyyy-MM format
min Date empty earliest date to accept in yyyy-MM format
step Integer empty integer, to read as month

Number type

Full documentation on Mozilla Number page, (*13)

Variable Type Default value if not set Accepted values
max Float empty empty
min Float empty empty
step Float empty empty

Password type

Full documentation on Mozilla Password page, (*14)

Variable Type Default value if not set Accepted values
maxlength Integer empty empty
minlength Integer empty empty
pattern String empty javascript regular expression
size Integer empty empty

Range type

Full documentation on Mozilla Range page, (*15)

Variable Type Default value if not set Accepted values
datalist Array empty list of suggestions users can pick to automatically fill the control's value
max Float empty empty
min Float empty empty
step Float empty empty

This range type will display an input number HTML tag with the field value., (*16)

Search type

Full documentation on Mozilla Search page, (*17)

Variable Type Default value if not set Accepted values
maxlength Integer empty empty
minlength Integer empty empty
pattern String empty javascript regular expression
size Integer empty empty
spellcheck Boolean false true or false

Tel type

Full documentation on Mozilla Tel page, (*18)

Variable Type Default value if not set Accepted values
maxlength Integer empty empty
minlength Integer empty empty
pattern String empty javascript regular expression
size Integer empty empty

Text type

Full documentation on Mozilla Text page, (*19)

Variable Type Default value if not set Accepted values
maxlength Integer empty empty
minlength Integer empty empty
pattern String empty javascript regular expression
size Integer empty empty
spellcheck Boolean false true or false

Time type

Full documentation on Mozilla Time page, (*20)

Variable Type Default value if not set Accepted values
max Date empty latest time to accept in hh:mm or hh:mm:ss format
min Date empty earliest time to accept in hh:mm or hh:mm:ss format
step Integer empty integer, to read as second

When the step variable is provided, browser will add the seconds input area adjacent to the minutes section.
The max and min variables format will automatically be forced to hh:mm:ss., (*21)

URL type

Full documentation on Mozilla URL page, (*22)

Variable Type Default value if not set Accepted values
datalist Array empty list of suggestions users can pick to automatically fill the control's value
maxlength Integer empty empty
minlength Integer empty empty
pattern String empty javascript regular expression
size Integer empty empty
spellcheck Boolean false true or false

Week type

Full documentation on Mozilla Week page, (*23)

Variable Type Default value if not set Accepted values
max Date empty latest time to accept in yyyy-Www format
min Date empty earliest time to accept in yyyy-Www format
step Integer empty integer, to read as 1week

Retrive data

Retrieve your value from Database with a simple get_option('my_text_field_id', '') (see WordPress reference):, (*24)

// Get text from Database
$text = get_option('my_text_field_id', '');

// Display text
echo $text;

Release History

Version Note
0.0.23 Fix jQuery integration on domReady
0.0.22 Change main DIV id to avoid HTML conflicts for labels
0.0.21 Enable datalist suggestions for range type

Contributing

  1. Fork it (https://github.com/GetOlympus/olympus-dionysos-field-text/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Built with ♥ by Achraf Chouk ~ (c) since a long time., (*25)

The Versions

01/05 2018

dev-master

9999999-dev https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Zeus Core framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus zeus hera

01/05 2018

v0.0.10

0.0.10.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Zeus Core framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus zeus

17/03 2018

v0.0.9

0.0.9.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Zeus Core framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus zeus

03/01 2017

v0.0.8

0.0.8.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera

08/10 2016

v0.0.7

0.0.7.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera

23/08 2016

v0.0.6

0.0.6.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera

23/08 2016

v0.0.5

0.0.5.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera

26/06 2016

v0.0.4

0.0.4.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera

10/05 2016

v0.0.3

0.0.3.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera

05/05 2016

v0.0.2

0.0.2.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera

29/04 2016

v0.0.1

0.0.1.0 https://github.com/GetOlympus/olympus-text-field

[READ-ONLY] Text field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php text field olympus hera