PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class THtmlWriter

THtmlWriter class

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 THtmlWriter::renderBeginTag() is accompanied with a THtmlWriter::renderEndTag() and they are properly nested, like nesting tags in HTML and XHTML.

TComponent
Extended by TApplicationComponent
Extended by THtmlWriter implements ITextWriter
Package: System\Web\UI
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/THtmlWriter.php
Methods summary
public
# __construct( ITextWriter $writer )

Constructor.

Constructor.

Parameters

$writer
ITextWriter
a writer that THtmlWriter will pass its rendering result to

Overrides

TComponent::__construct()
public
# getWriter( )
public
# setWriter( mixed $writer )
public
# addAttributes( array $attrs )

Adds a list of attributes to be rendered.

Adds a list of attributes to be rendered.

Parameters

$attrs
array
list of attributes to be rendered
public
# addAttribute( string $name, string $value )

Adds an attribute to be rendered.

Adds an attribute to be rendered.

Parameters

$name
string
name of the attribute
$value
string
value of the attribute
public
# removeAttribute( string $name )

Removes the named attribute from rendering

Removes the named attribute from rendering

Parameters

$name
string
name of the attribute to be removed
public
# addStyleAttributes( array $attrs )

Adds a list of stylesheet attributes to be rendered.

Adds a list of stylesheet attributes to be rendered.

Parameters

$attrs
array
list of stylesheet attributes to be rendered
public
# addStyleAttribute( string $name, string $value )

Adds a stylesheet attribute to be rendered

Adds a stylesheet attribute to be rendered

Parameters

$name
string
stylesheet attribute name
$value
string
stylesheet attribute value
public
# removeStyleAttribute( string $name )

Removes the named stylesheet attribute from rendering

Removes the named stylesheet attribute from rendering

Parameters

$name
string
name of the stylesheet attribute to be removed
public string
# flush( )

Flushes the rendering result. This will invoke the underlying writer's flush method.

Flushes the rendering result. This will invoke the underlying writer's flush method.

Returns

string
the content being flushed

Implementation of

ITextWriter::flush()
public
# write( string $str )

Renders a string.

Renders a string.

Parameters

$str
string
string to be rendered

Implementation of

ITextWriter::write()
public
# writeLine( string $str = '' )

Renders a string and appends a newline to it.

Renders a string and appends a newline to it.

Parameters

$str
string
string to be rendered
public
# writeBreak( )

Renders an HTML break.

Renders an HTML break.

public
# renderBeginTag( string $tagName )

Renders the openning tag.

Renders the openning tag.

Parameters

$tagName
string
tag name
public
# renderEndTag( )

Renders the closing tag.

Renders the closing tag.

Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO