To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

Official ZPE Programming Environment documentationZPEHTMLBuilder

Introduction

ZPE 1.7.8 (July 2019) added the ZPEHTMLBuilder object. This is a useful set of functions that helps to develop HTML from ZPE internal constructs. For example, the list_to_html_list function can convert a ZPEList or ZPEArray to HTML in one method.

ZPEHTMLBuilder object functions

The following is a list of internal functions the ZPEHTMLBuilder object exposes. All functions are ZPEObjectNativeFunctions unless specified therefore run in native code.

list_to_html_list (list array, [boolean ordered]) ⇒ string
Converts a ZPEList into an HTML <ul> tag composed of inner <li> tags. If ordered is true, then the <ul> tags become <ol> tags.
map_to_html_definition_list (associative_array array) ⇒ string
Converts a ZPEAssociativeArray into an HTML <dl> tag composed of inner <dt> and <dd> tags.
list_to_html_table (list array) ⇒ string
Converts a ZPEList of ZPELists into to an HTML <table> tag composed of inner <tr> and <td> tags.
Added in 1.7.9

Examples

The following example will transform a ZPEList into a HTML list:

YASS
$h = new ZPEHTMLBuilder()
$l = ["Warcraft III", "Age of Empires II", "Command and Conquer 95"]
$output = $h->list_to_html_list($l, true)

print($output)
    
Comments
anonymous_function:
2019-07-02 00:51:44
Very useful object
This object has been good in my testing Jamie. I really like the simplicity of it.
jamiebalfour04
Thanks Carl, the late reply is because I have just added replies to BalfComment on my website.
anonymous_function:
2019-07-02 11:51:16
Converting to dd doesn't work on inner arrays
As the title says
jamiebalfour04
This is now fixed.
New comment
Reply
Provide feedback on this page
Comments are sent via email to me.