$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.
显示文件
Open project: pradosoft/prado
Class Usage Examples
Method | Description | |
---|---|---|
__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. |
public addAttribute ( $name, $value ) |
public addAttributes ( $attrs ) |
public addStyleAttribute ( $name, $value ) |
public addStyleAttributes ( $attrs ) |
public removeAttribute ( $name ) |
public removeStyleAttribute ( $name ) |
public writeLine ( $str = '' ) |