View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_View_Helper_XmlDeclaration
{zone-data}

{zone-data:proposer-list}
[Geoffrey Tran|http://geoffreytran.com] ([Google+|https://plus.google.com/102769558499878260901?rel=author])

{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 1 January 2008: Initial Draft.
{zone-data}

{zone-data:overview}
The xml declaration helper generates xml declarations (<?xml version="1.0" ?>) just like its name suggests. Whenever you are using PHP for templates, you should use the xmlDeclaration helper because of inconsistencies between environments. You'll never know if short tags is enabled or not which can cause errors with xml declarations.
{zone-data}

{zone-data:references}
* [Zym Project XmlDeclaration Helper|http://www.zym-project.com/docs/reference/zym.view.html#zym.view.helpers.xmldeclaration]
* [XmlDeclaration Helper| http://code.google.com/p/zym/source/browse/trunk/library/Zym/View/Helper/XmlDeclaration.php?r=740]
{zone-data}

{zone-data:requirements}
* This component *will* output an xml declaration
* This component *will* allow specification of version, encoding and standalone attributes
{zone-data}

{zone-data:dependencies}
{zone-data}

{zone-data:operation}
Simply echo's an xml declaration
{zone-data}

{zone-data:milestones}
* Milestone 1: [DONE] Create proposal
* Milestone 2: [DONE] Working prototype, Documentation, Unit Tests
* Milestone 3: Working prototype checked into the incubator
* Milestone 4: Unit tests exist, work, and are checked into SVN.
* Milestone 5: Initial documentation exists.
{zone-data}

{zone-data:class-list}
* Zend_View_Helper_XmlDeclaration
{zone-data}

{zone-data:use-cases}
||UC-01||

Since it is not always known whether shorttags is enabled or not.
{code}
<?= $this->xmlDeclaration() ?>
<html>
[<?xml version="1.0" encoding="UTF-8" ?>]

<?= $this->xmlDeclaration('1.0') ?>
<html>
[<?xml version="1.0" encoding="UTF-8" ?>]

<?= $this->xmlDeclaration('1.1', 'UTF-16') ?>
<html>
[<?xml version="1.0" encoding="UTF-16" ?>]

<?= $this->xmlDeclaration('1.1', 'UTF-16', 'yes') ?>
<html>
[<?xml version="1.0" encoding="UTF-16" standalone="yes" ?>]
{code}
{zone-data}

{zone-data:skeletons}
{code}
class Zend_View_Helper_XmlDeclaration
{
public function xmlDeclaration($version = '1.0', $encoding = 'UTF-8', $standalone = null)
{}
}
{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>