本文整理汇总了PHP中TextField::getAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP TextField::getAttributes方法的具体用法?PHP TextField::getAttributes怎么用?PHP TextField::getAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextField
的用法示例。
在下文中一共展示了TextField::getAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAttributes
public function getAttributes()
{
if ($this->getPage()->isMainSite()) {
return parent::getAttributes();
}
return array_merge(TextField::getAttributes(), array('data-prefix' => $this->getURLPrefix(), 'data-suffix' => '?stage=', 'data-default-url' => $this->getDefaultURL()));
}
示例2: getAttributes
/**
* @return array
*/
public function getAttributes()
{
$attributes = [];
$attributes['type'] = 'number';
$attributes['autocomplete'] = 'off';
$attributes['required'] = 'required';
return array_merge(parent::getAttributes(), $attributes);
}
示例3: getAttributes
function getAttributes() {
return array_merge(
parent::getAttributes(),
array(
'type' => 'email'
)
);
}
示例4: getAttributes
/**
* Set additional attributes
* @return array Attributes
*/
public function getAttributes()
{
$attributes = array('placeholder' => $this->config['defaultparts']['scheme'] . "://example.com");
if ($this->config['html5validation']) {
$attributes += array('type' => 'url', 'pattern' => 'https?://.+');
}
return array_merge(parent::getAttributes(), $attributes);
}
示例5: getAttributes
public function getAttributes()
{
$attributes = array_merge(parent::getAttributes(), array('type' => 'password'));
$autocomplete = Config::inst()->get('PasswordField', 'autocomplete');
if (isset($autocomplete)) {
$attributes['autocomplete'] = $autocomplete ? 'on' : 'off';
}
return $attributes;
}
示例6: getAttributes
/**
* @return Array
*/
public function getAttributes()
{
$attributes = array_merge(parent::getAttributes(), array('type' => 'hidden', 'data-searchurl' => $this->Link('search'), 'data-minimuminputlength' => $this->getConfig('minimumInputLength'), 'data-resultslimit' => $this->getConfig('resultsLimit'), 'data-placeholder' => $this->getConfig('placeholder'), 'data-multiple' => $this->getConfig('multiple')));
if ($this->Value() && ($object = DataObject::get($this->getConfig('classToSearch'))->byID($this->Value()))) {
$originalSourceFileComments = Config::inst()->get('SSViewer', 'source_file_comments');
Config::inst()->update('SSViewer', 'source_file_comments', false);
$attributes['data-selectioncontent'] = html_entity_decode(SSViewer::fromString($this->getConfig('selectionFormat'))->process($object));
Config::inst()->update('SSViewer', 'source_file_comments', $originalSourceFileComments);
}
return $attributes;
}
示例7: getAttributes
/**
* {@inheritdoc}
*/
public function getAttributes()
{
$attributes = array('type' => 'password');
$autocomplete = Config::inst()->get('PasswordField', 'autocomplete');
if ($autocomplete) {
$attributes['autocomplete'] = 'on';
} else {
$attributes['autocomplete'] = 'off';
}
return array_merge(parent::getAttributes(), $attributes);
}
示例8: getAttributes
/**
* @return array
*/
function getAttributes()
{
return array_merge(parent::getAttributes(), array('data-source' => $this->getSuggestURL(), 'data-min-length' => $this->getMinSearchLength(), 'data-require-selection' => $this->getRequireSelection(), 'autocomplete' => 'off', 'name' => $this->getName() . '__autocomplete'));
}
示例9: getAttributes
function getAttributes()
{
$this->extraClasses[] = 'text';
if (isset($_GET)) {
$query = $_GET;
if (isset($query['url'])) {
unset($query['url']);
}
$query = http_build_query($query);
} else {
$query = '';
}
$attributes = array_merge(['data-suggest-url' => $this->SuggestURL ? Controller::join_links($this->SuggestURL, '?' . $query, sprintf('?%s=%%QUERY', $this->queryKey)) : false, 'data-prefetch-url' => $this->PrefetchURL ? Controller::join_links($this->PrefetchURL, '?' . $query) : false, 'data-min-length' => $this->minSearchLength, 'data-require-selection' => $this->requireSelection, 'data-name' => strtolower($this->ID()), 'data-templates.empty' => _t('TypeAheadField.NO_MATCHES', 'No matches found')], parent::getAttributes(), ['autocomplete' => 'off']);
if (!$this->form || !$this->SuggestURL && !$this->PrefetchURL || is_array($this->SourceList)) {
if ($list = $this->SourceList) {
$results = $this->results('', $list, null, false);
} else {
$results = [];
}
$attributes['data-local'] = json_encode($results);
}
if (is_array($this->SourceList)) {
unset($attributes['data-suggest-url']);
unset($attributes['data-prefetch-url']);
}
return $attributes;
}
示例10: getAttributes
function getAttributes() {
return array_merge(
parent::getAttributes(),
array('type' => 'password')
);
}
示例11: getAttributes
public function getAttributes()
{
$attrs = parent::getAttributes();
return array_merge($attrs, array('type' => $this->EditableField() ? 'text' : 'hidden'));
}
示例12: getAttributes
/**
* @return array
*/
public function getAttributes()
{
$atts = array_merge(parent::getAttributes(), array('data-source' => $this->getSuggestURL(), 'data-min-length' => $this->getMinSearchLength(), 'data-require-selection' => $this->getRequireSelection(), 'autocomplete' => 'off', 'name' => $this->getName() . '__autocomplete', 'placeholder' => 'Search on ' . implode(' or ', $this->getSourceFields())));
// Unset the value so we start with a clear search form
$atts['value'] = null;
return $atts;
}
示例13: getAttributes
/**
* {@inheritDoc}
*/
public function getAttributes()
{
return array_merge(parent::getAttributes(), array('value' => $this->getOption('always_empty') && !$this->isBound() ? '' : $this->getDisplayedData(), 'type' => 'password'));
}
示例14: getAttributes
public function getAttributes()
{
return array_merge(parent::getAttributes(), array('data-prefix' => $this->getURLPrefix(), 'data-suffix' => '?stage=Stage'));
}
示例15: getAttributes
/**
* Returns the attributes
*
* @return array
*/
public function getAttributes()
{
return array_merge(parent::getAttributes(), array('placeholder' => $this->getPlaceholder()));
}