私はこのDOMElementを持っています。DOMElementから属性を取得する方法
私は2つの質問があります:オブジェクトの値は省略意味は何
1)?
2)どのようにしてこのDOMElementから属性を取得できますか?
object(DOMElement)#554 (18) {
["tagName"]=>
string(5) "input"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(5) "input"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(5) "input"
["baseURI"]=>
NULL
["textContent"]=>
string(0) ""
}
私はオブジェクトにアクセスするためにこのクラスを作成しました。これは、入力フィールドからtype属性を取得できるようにするためです。
<?php
namespace App\Model;
class Field
{
/**
* @var \DOMElement
*/
protected $node;
public function __construct($node){
$this->node = $node;
}
public function getNode(){
return $this->node;
}
public function getTagName(){
foreach ($this->node as $value) {
return $value->tagName;
}
}
public function getAttribute(){
}
}