WPCF7_HTMLFormatter::format
Outputs formatted HTML based on the given chunks.
Метод класса: WPCF7_HTMLFormatter{}
Хуков нет.
Возвращает
Строку. Formatted HTML.
Использование
$WPCF7_HTMLFormatter = new WPCF7_HTMLFormatter(); $WPCF7_HTMLFormatter->format( $chunks );
- $chunks(iterable) (обязательный)
- The original chunks.
Код WPCF7_HTMLFormatter::format() WPCF7 HTMLFormatter::format CF7 6.1.4
public function format( $chunks ) {
$chunks = $this->pre_format( $chunks );
$chunks = $this->concatenate_texts( $chunks );
$this->output = '';
$this->stacked_elements = array();
foreach ( $chunks as $chunk ) {
if ( self::text === $chunk['type'] ) {
$this->append_text( $chunk['content'] );
}
if ( self::start_tag === $chunk['type'] ) {
$this->start_tag( $chunk['content'] );
}
if ( self::end_tag === $chunk['type'] ) {
$this->end_tag( $chunk['content'] );
}
if ( self::comment === $chunk['type'] ) {
$this->append_comment( $chunk['content'] );
}
}
return $this->output();
}