Table_Wrapper_Helper
in package
Helper class for generating table wrappers for email blocks.
Table of Contents
- DEFAULT_TABLE_ATTRS = array('border' => '0', 'cellpadding' => '0', 'cellspacing' => '0', 'role' => 'presentation')
- Default table attributes.
- render_outlook_table_cell() : string
- Render an Outlook-specific table cell using conditional comments.
- render_outlook_table_wrapper() : string
- Render an Outlook-specific table wrapper using conditional comments.
- render_table_cell() : string
- Render a table cell.
- render_table_wrapper() : string
- Render a table wrapper for email blocks.
- build_attributes_string() : string
- Build an HTML attributes string from an array.
Constants
DEFAULT_TABLE_ATTRS
Default table attributes.
private
array<string, string>
DEFAULT_TABLE_ATTRS
= array('border' => '0', 'cellpadding' => '0', 'cellspacing' => '0', 'role' => 'presentation')
Methods
render_outlook_table_cell()
Render an Outlook-specific table cell using conditional comments.
public
static render_outlook_table_cell(string $content[, array<string|int, mixed> $cell_attrs = array() ]) : string
Parameters
- $content : string
-
The content to wrap.
- $cell_attrs : array<string|int, mixed> = array()
-
Cell attributes.
Return values
string — The generated table cell HTML with Outlook conditionals.render_outlook_table_wrapper()
Render an Outlook-specific table wrapper using conditional comments.
public
static render_outlook_table_wrapper(string $content[, array<string|int, mixed> $table_attrs = array() ][, array<string|int, mixed> $cell_attrs = array() ][, array<string|int, mixed> $row_attrs = array() ][, bool $render_cell = true ]) : string
Parameters
- $content : string
-
The content to wrap (e.g., '{block_content}').
- $table_attrs : array<string|int, mixed> = array()
-
Table attributes to merge with defaults.
- $cell_attrs : array<string|int, mixed> = array()
-
Cell attributes.
- $row_attrs : array<string|int, mixed> = array()
-
Row attributes.
- $render_cell : bool = true
-
Whether to render the td wrapper (default true).
Return values
string — The generated table wrapper HTML.render_table_cell()
Render a table cell.
public
static render_table_cell(string $content[, array<string|int, mixed> $cell_attrs = array() ]) : string
Parameters
- $content : string
-
The content to wrap.
- $cell_attrs : array<string|int, mixed> = array()
-
Cell attributes.
Return values
string — The generated table cell HTML.render_table_wrapper()
Render a table wrapper for email blocks.
public
static render_table_wrapper(string $content[, array<string|int, mixed> $table_attrs = array() ][, array<string|int, mixed> $cell_attrs = array() ][, array<string|int, mixed> $row_attrs = array() ][, bool $render_cell = true ]) : string
Parameters
- $content : string
-
The content to wrap (e.g., '{block_content}').
- $table_attrs : array<string|int, mixed> = array()
-
Table attributes to merge with defaults.
- $cell_attrs : array<string|int, mixed> = array()
-
Cell attributes.
- $row_attrs : array<string|int, mixed> = array()
-
Row attributes.
- $render_cell : bool = true
-
Whether to render the td wrapper (default true).
Return values
string — The generated table wrapper HTML.build_attributes_string()
Build an HTML attributes string from an array.
private
static build_attributes_string(array<string, string> $attributes) : string
Parameters
- $attributes : array<string, string>
-
The attributes array.