Public Member Functions | |
| setContent ($content) | |
| Sets content to validate. | |
| getContent () | |
| getMessages () | |
| setConfig ($config) | |
| Sets configuration array for tidy. | |
| getConfig () | |
| setHeader ($header) | |
| Sets header for content. | |
| getHeader () | |
| setEncoding ($encoding) | |
| Sets encoding for content. | |
| getEncoding () | |
| getErrorCount () | |
| getWarningCount () | |
| validateContent ($content=null) | |
| Do the content validation and repair it. | |
Static Public Member Functions | |
| static | create () |
| |
Private Member Functions | |
| countTags ($tag, $text) | |
Private Attributes | |
| $content = null | |
| $messages = null | |
| $errorCount = null | |
| $warningCount = null | |
| $config | |
| $header | |
| $headerLines = 7 | |
| $encoding = 'utf8' | |
Definition at line 18 of file TidyValidator.class.php.
| static TidyValidator::create | ( | ) | [static] |
| TidyValidator::setContent | ( | $ | content | ) |
Sets content to validate.
For example: TidyValidator::create()->setContent('blabla');
| $content | content itself |
Definition at line 61 of file TidyValidator.class.php.
References $content.
Referenced by validateContent().
| TidyValidator::getContent | ( | ) |
| TidyValidator::getMessages | ( | ) |
Definition at line 73 of file TidyValidator.class.php.
| TidyValidator::setConfig | ( | $ | config | ) |
Sets configuration array for tidy.
There is default config (see code).
For example: TidyValidator::create()->setConfig('output-xhtml' => true);
| $config | array with tidy's configuration |
Definition at line 86 of file TidyValidator.class.php.
References $config.
| TidyValidator::getConfig | ( | ) |
| TidyValidator::setHeader | ( | $ | header | ) |
Sets header for content.
There is default header (see code).
| $header | header string |
Definition at line 104 of file TidyValidator.class.php.
References $header.
| TidyValidator::getHeader | ( | ) |
| TidyValidator::setEncoding | ( | $ | encoding | ) |
Sets encoding for content.
There is default encoding 'utf8'.
For example: TidyValidator::create()->setEncoding('utf8');
| $encoding | encoding name |
Definition at line 125 of file TidyValidator.class.php.
References $encoding.
| TidyValidator::getEncoding | ( | ) |
| TidyValidator::getErrorCount | ( | ) |
Definition at line 137 of file TidyValidator.class.php.
| TidyValidator::getWarningCount | ( | ) |
Definition at line 142 of file TidyValidator.class.php.
| TidyValidator::validateContent | ( | $ | content = null |
) |
Do the content validation and repair it.
For example: $repairedContent = TidyValidator::create()-> setContent('blablabla')-> validateContent()-> getContent();
Or just: $repairedContent = TidyValidator::create()-> validateContent('blablabla')-> getContent();
$content content to validate
Definition at line 166 of file TidyValidator.class.php.
References $content, $out, countTags(), getConfig(), getContent(), getEncoding(), getHeader(), Assert::isTrue(), n, and setContent().

| TidyValidator::countTags | ( | $ | tag, | |
| $ | text | |||
| ) | [private] |
TidyValidator::$content = null [private] |
Definition at line 20 of file TidyValidator.class.php.
Referenced by setContent(), and validateContent().
TidyValidator::$messages = null [private] |
Definition at line 21 of file TidyValidator.class.php.
TidyValidator::$errorCount = null [private] |
Definition at line 22 of file TidyValidator.class.php.
TidyValidator::$warningCount = null [private] |
Definition at line 23 of file TidyValidator.class.php.
TidyValidator::$config [private] |
Initial value:
array(
'output-xhtml' => true,
'doctype' => 'strict',
'wrap' => 0,
'quote-marks' => true,
'drop-empty-paras' => true
)
Definition at line 25 of file TidyValidator.class.php.
Referenced by setConfig().
TidyValidator::$header [private] |
Initial value:
'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>'
Definition at line 33 of file TidyValidator.class.php.
Referenced by setHeader().
TidyValidator::$headerLines = 7 [private] |
Definition at line 41 of file TidyValidator.class.php.
TidyValidator::$encoding = 'utf8' [private] |
1.5.4