PHP 클래스 Prado\Web\UI\THtmlWriter

THtmlWriter is a writer that renders valid XHTML outputs. It provides functions to render tags, their attributes and stylesheet fields. Attribute and stylesheet values will be automatically HTML-encoded if they require so. For example, the 'value' attribute in an input tag will be encoded. A common usage of THtmlWriter is as the following sequence: $writer->addAttribute($name1,$value1); $writer->addAttribute($name2,$value2); $writer->renderBeginTag($tagName); ... render contents enclosed within the tag here $writer->renderEndTag(); Make sure each invocation of {@link renderBeginTag} is accompanied with a {@link renderEndTag} and they are properly nested, like nesting tags in HTML and XHTML.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends Prado\TApplicationComponent, implements Prado\IO\ITextWriter
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $writer ) Constructor.
addAttribute ( $name, $value ) Adds an attribute to be rendered.
addAttributes ( $attrs ) Adds a list of attributes to be rendered.
addStyleAttribute ( $name, $value ) Adds a stylesheet attribute to be rendered
addStyleAttributes ( $attrs ) Adds a list of stylesheet attributes to be rendered.
flush ( ) : string Flushes the rendering result.
getWriter ( )
removeAttribute ( $name ) Removes the named attribute from rendering
removeStyleAttribute ( $name ) Removes the named stylesheet attribute from rendering
renderBeginTag ( $tagName ) Renders the openning tag.
renderEndTag ( ) Renders the closing tag.
setWriter ( $writer )
write ( $str ) Renders a string.
writeBreak ( ) Renders an HTML break.
writeLine ( $str = '' ) Renders a string and appends a newline to it.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( $writer )

addAttribute() 공개 메소드

Adds an attribute to be rendered.
public addAttribute ( $name, $value )

addAttributes() 공개 메소드

Adds a list of attributes to be rendered.
public addAttributes ( $attrs )

addStyleAttribute() 공개 메소드

Adds a stylesheet attribute to be rendered
public addStyleAttribute ( $name, $value )

addStyleAttributes() 공개 메소드

Adds a list of stylesheet attributes to be rendered.
public addStyleAttributes ( $attrs )

flush() 공개 메소드

This will invoke the underlying writer's flush method.
public flush ( ) : string
리턴 string the content being flushed

getWriter() 공개 메소드

public getWriter ( )

removeAttribute() 공개 메소드

Removes the named attribute from rendering
public removeAttribute ( $name )

removeStyleAttribute() 공개 메소드

Removes the named stylesheet attribute from rendering
public removeStyleAttribute ( $name )

renderBeginTag() 공개 메소드

Renders the openning tag.
public renderBeginTag ( $tagName )

renderEndTag() 공개 메소드

Renders the closing tag.
public renderEndTag ( )

setWriter() 공개 메소드

public setWriter ( $writer )

write() 공개 메소드

Renders a string.
public write ( $str )

writeBreak() 공개 메소드

Renders an HTML break.
public writeBreak ( )

writeLine() 공개 메소드

Renders a string and appends a newline to it.
public writeLine ( $str = '' )