PHP code example of heimrichhannot / contao-tagsinput
1. Go to this page and download the library: Download heimrichhannot/contao-tagsinput 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/ */
heimrichhannot / contao-tagsinput example snippets
'locations' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_entity_lock']['locations'],
'inputType' => 'tagsinput',
'sql' => "varchar(255) NOT NULL default ''",
'options' => array('boston', 'berlin', 'hamburg', 'london'),
'eval' => array
(
'freeInput' => false
'tl_class' => 'w50 autoheight'
)
),
'locations' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_entity_lock']['locations'],
'inputType' => 'tagsinput',
'sql' => "blob NULL",
'options' => array('boston', 'berlin', 'hamburg', 'london'),
'eval' => array
(
'multiple' => true,
'freeInput' => true,
'multiple' => true,
'maxTags' => 3,
'maxChars' => 12,
'trimValue' => true,
'allowDuplicates' => true,
'tl_class' => 'w50 autoheight'
)
),
'locations' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_entity_lock']['locations'],
'inputType' => 'tagsinput',
'sql' => "varchar(255) NOT NULL default ''",
'eval' => array
(
'freeInput' => true,
'tl_class' => 'w50 autoheight'
)
),
'locations' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_entity_lock']['locations'],
'inputType' => 'tagsinput',
'sql' => "blob NULL",
'eval' => array
(
'multiple' => true,
'freeInput' => true,
'tl_class' => 'w50 autoheight'
)
),
'locations' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_entity_lock']['locations'],
'inputType' => 'tagsinput',
'sql' => "int(10) unsigned NOT NULL default '0'",
'eval' => array(
'placeholder' => &$GLOBALS['TL_LANG']['tl_member']['placeholders']['locations'],
'freeInput' => false,
'mode' => \TagsInput::MODE_REMOTE,
'remote' => array
(
'fields' => array('title', 'id'),
'format' => '%s [ID:%s]',
'queryField' => 'title',
'queryPattern' => '%QUERY%',
'foreignKey' => '%parentTable%.id',
'limit' => 10
),
'tl_class' => 'w50 autoheight'
)
),
'locations' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_entity_lock']['locations'],
'inputType' => 'tagsinput',
'sql' => "blob NULL",
'eval' => array(
'placeholder' => &$GLOBALS['TL_LANG']['tl_member']['placeholders']['locations'],
'freeInput' => true,
'mode' => \TagsInput::MODE_REMOTE,
'remote' => array
(
'fields' => array('title', 'id'),
'format' => '%s [ID:%s]',
'queryField' => 'title',
'queryPattern' => '%QUERY%',
'foreignKey' => '%parentTable%.id',
'limit' => 10
),
'save_tags' => array(
'table' => 'tl_calendar_events',
'tagField' => 'title',
'defaults' => array
(
'tstamp' => time(),
'pid' => 1,
'type' => 'community',
'published' => false
)
),
'tl_class' => 'w50 autoheight'
)
),
'locations' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_entity_lock']['locations'],
'inputType' => 'tagsinput',
'options' => array('boston', 'berlin', 'hamburg', 'london'),
'sql' => "blob NULL",
'eval' => array(
'placeholder' => &$GLOBALS['TL_LANG']['tl_member']['placeholders']['locations'],
'freeInput' => true,
'mode' => \TagsInput::MODE_REMOTE,
'remote' => array
(
'queryPattern' => '%QUERY%',
'limit' => 10
),
'tags_callback' => array(array('MyClass', 'addTagAttributes')),
'tl_class' => 'w50 autoheight'
),
),