1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00

Add interface for Inputfields that accept page selector

This commit is contained in:
Ryan Cramer
2021-04-28 13:50:58 -04:00
parent 94d8cae85a
commit c6f735b306
2 changed files with 19 additions and 1 deletions

View File

@@ -481,7 +481,8 @@ abstract class Inputfield extends WireData implements Module {
if(strlen($value)) return $value;
if($this->skipLabel & self::skipLabelBlank) return '';
return $this->attributes['name'];
}
}
if($key === 'description' || $key === 'notes') return parent::get($key);
if($key === 'name' || $key === 'value' || $key === 'id') return $this->getAttribute($key);
if($key === 'attributes') return $this->attributes;
if($key === 'parent') return $this->parent;

View File

@@ -575,6 +575,23 @@ interface InputfieldSupportsArrayValue {
public function setArrayValue(array $value);
}
/**
* Inputfield that supports a Page selector for selectable options
*
* @since 3.0.176
*
*/
interface InputfieldSupportsPageSelector {
/**
* Set page selector or test if feature is disabledd
*
* @param string $selector Selector string or blank string when testing if feature is disabled
* @return bool Return boolean false if feature disabled, otherwise boolean true
*
*/
public function setPageSelector($selector);
}
/**
* Inputfield that has a text value by default
*