Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationHTMLBuilder object

Introduction

ZPE 1.7.8 (July 2019) added the HTMLBuilder 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.

HTMLBuilder object functions

The following is a list of internal functions the HTMLBuilder 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 HTMLBuilder()
$l = ["Warcraft III", "Age of Empires II", "Command and Conquer 95"]
$output = $h->list_to_html_list($l, true)

print($output)
    
Comments
Feedback 👍
Comments are sent via email to me.