Horde_ActiveSync_Wbxml_Encoder::startTag PHP Method

startTag() public method

Start output for the specified tag
public startTag ( string $tag, mixed $attributes = false, boolean $output_empty = false )
$tag string The name of the tag to start
$attributes mixed Any attributes for the start tag
$output_empty boolean Force output of empty tags
    public function startTag($tag, $attributes = false, $output_empty = false)
    {
        $stackelem = array();
        if (!$output_empty) {
            $stackelem['tag'] = $tag;
            $stackelem['attributes'] = $attributes;
            $stackelem['sent'] = false;
            $this->_stack[] = $stackelem;
        } else {
            /* Flush the stack if we want to force empty tags */
            $this->_outputStack();
            $this->_startTag($tag, $attributes, $output_empty);
        }
    }

Usage Example

Example #1
0
 /**
  * Send WBXML to indicate provisioning is required.
  *
  * @param string $requestType  The type of request we are handling.
  * @param integer $status      The reason we need to provision.
  */
 protected function _requireProvisionWbxml($requestType, $status)
 {
     $this->_encoder->startWBXML();
     $this->_encoder->startTag($requestType);
     $this->_encoder->startTag(Horde_ActiveSync::SYNC_STATUS);
     $this->_encoder->content($status);
     $this->_encoder->endTag();
     $this->_encoder->endTag();
 }
All Usage Examples Of Horde_ActiveSync_Wbxml_Encoder::startTag