Exemplo n.º 1
0
function glazyBegin($tagNameOrElementOptions, $valueType = GLAZE_TYPE_PREGLAZED)
{
    glazyEnsureOpeningTag();
    $elementInfo = glazyElementInfoForPassedOptions($tagNameOrElementOptions);
    $tagName = $elementInfo['tagName'];
    $attributes = $elementInfo['attributes'];
    echo "<{$tagName}";
    $elementsBuffer =& glazyGetElementsBuffer(array('begin' => true));
    $openElements =& glazyGetOpenElements(true);
    $openElementsCount = count($openElements);
    if (empty($openElements)) {
        ob_start();
    } else {
        ob_start();
    }
    $openElements[] = array('tagName' => $tagName, 'openingTagDone' => false, 'valueType' => $valueType);
    if (!empty($attributes)) {
        glazyAttributesArray($attributes);
    }
    // Return info for glazyFinish.
    return array('_glazyBegin_' => true, 'tagName' => $tagName, 'previousOpenElementsCount' => $openElementsCount);
}
Exemplo n.º 2
0
function glazyBegin($tagNameOrElementOptions, $contentType = GLAZE_TYPE_PREGLAZED)
{
    global $glazyOpenElements;
    glazyEnsureOpeningTag();
    $elementInfo = glazyPrepareElement($tagNameOrElementOptions);
    $tagName = $elementInfo['tagName'];
    $attributes = $elementInfo['attributes'];
    echo "<{$tagName}";
    glazyBeginAttributesBufferIfNeeded();
    if (!isset($glazyOpenElements)) {
        $glazyOpenElements = array();
    }
    $openElementsCountBefore = count($glazyOpenElements);
    if (empty($glazyOpenElements)) {
        ob_start();
    } else {
        ob_start();
    }
    $glazyOpenElements[] = array('tagName' => $tagName, 'openingTagDone' => false, 'contentType' => $contentType);
    if (!empty($attributes)) {
        glazyAttributesArray($attributes);
    }
    // Return info for glazyFinish.
    return array('_glazyBegin_' => true, 'tagName' => $tagName, 'previousOpenElementsCount' => $openElementsCountBefore);
}