Library
Class

Library\Helper\ConditionalComment

class ConditionalComment

Internet Explorer conditional HTML comment

As for all helpers, all methods are statics.

For convenience, the best practice is to use:

use Library\Helper\ConditionalComment as ConditionalCommentHelper;
// or
use Library\Helper\ConditionalComment as CCHelper;

Properties

static $condition_shortcuts Shortcuts to use in conditions
static $operator_shortcuts Operators to use in conditions
static $conditional_item
static $internet_explorer

Methods

static string buildCondition($content, $condition = 'if IE', $operator = 'OR', $global = false)

Build an HTML condition string for Internet Explorer around content

static string writeCondition(string $content, string $condition = null, bool $global = false)

Write an HTML condition for Internet Explorer around content

static string parseSingleCondition(string $condition)

Parse a single condition item replacing shortcuts

Details

at line 88
static public string buildCondition($content, $condition = 'if IE', $operator = 'OR', $global = false)

Build an HTML condition string for Internet Explorer around content

Condition can be an array of conditions, that will be related with the operator.

Each condition can be written like ">=5" for instance, to define a condition for IE "greater than or equal to" version 5.

Parameters

$content
$condition
$operator
$global

Return Value

string

at line 120
static public string writeCondition(string $content, string $condition = null, bool $global = false)

Write an HTML condition for Internet Explorer around content

Parameters

string $content
string $condition
bool $global May the content be also defined globally

Return Value

string

at line 144
static public string parseSingleCondition(string $condition)

Parse a single condition item replacing shortcuts

To build a final multi-items condition string, pass to this function a string like "AND ..." which will render "&(...)". To build a NOT condition string, pass to this function a string like "NOT ..." which will render "!(...)".

Parameters

string $condition

Return Value

string