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

Add __debugInfo() method to Inputfield class

This commit is contained in:
Ryan Cramer
2021-07-02 12:30:18 -04:00
parent 48a80058e4
commit 4aebc4a203

View File

@@ -1840,6 +1840,29 @@ abstract class Inputfield extends WireData implements Module {
if(!is_null($setEditable)) $this->editable = $setEditable ? true : false;
return $this->editable;
}
/**
* debugInfo PHP 5.6+ magic method
*
* @return array
*
*/
public function __debugInfo() {
$info = array(
'className' => $this->className(),
'attributes' => $this->attributes,
'wrapAttributes' => $this->wrapAttributes,
);
if(is_object($this->parent)) {
$info['parent'] = array(
'className' => $this->parent->className(),
'name' => $this->parent->attr('name'),
'id' => $this->parent->attr('id'),
);
}
$info = array_merge($info, parent::__debugInfo());
return $info;
}
/**
* Set custom html render, see $this->html at top for reference.