phpday 2027 - Call for Papers

tidyNode クラス

(PHP 5, PHP 7, PHP 8)

はじめに

HTML ファイル中の HTML ノードで、tidy が検出したものです。

クラス概要

final class tidyNode {
/* プロパティ */
public readonly string $value;
public readonly string $name;
public readonly int $type;
public readonly int $line;
public readonly int $column;
public readonly bool $proprietary;
public readonly ?int $id;
public readonly ?array $attribute;
public readonly ?array $child;
/* メソッド */
private function __construct()
public function getNextSibling(): ?tidyNode
public function getParent(): ?tidyNode
public function getPreviousSibling(): ?tidyNode
public function hasChildren(): bool
public function hasSiblings(): bool
public function isAsp(): bool
public function isComment(): bool
public function isHtml(): bool
public function isJste(): bool
public function isPhp(): bool
public function isText(): bool
}

プロパティ

value

まわりのタグも含む、ノードの HTML 表現

name

HTML ノードの名前

type

ノードの型 (tidy ノード型定数 のうちのひとつ。たとえば TIDY_NODETYPE_PHP)

line

ファイル内でそのタグが存在する行番号

column

ファイル内でそのタグが存在するカラム番号

proprietary

そのノードが独自タグであるかどうかを表す

id

ノードの ID (tag 定数のうちのひとつで、たとえば TIDY_TAG_FRAME)

attribute

現在のノードの属性名 (キー) を表す文字列の配列

child

現在のノードの子を表す tidyNode の配列

目次

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top