Skip to end of metadata
Go to start of metadata

Zend Framework: Zend_View_Helper_HeadBase Component Proposal

Proposed Component Name Zend_View_Helper_HeadBase
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_View_Helper_HeadBase
Proposers Phil Brown
Zend Liaison TBD
Revision 1.0 - 16 March 2010: Initial Draft.
1.1 - 24 May 2010: Renamed to HeadBase (wiki revision: 6)

Table of Contents

1. Overview

Zend_View_Helper_HeadBase is used to generate an HTML base tag, taking into consideration doctype, server address and base URL.

2. References

http://www.w3.org/TR/html401/struct/links.html#h-12.4

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will generate valid HTML or XHTML depending on chosen doctype.
  • This component will generate a valid, default base href consisting of protocol, domain, port and base path when no href is provided.
  • This component will add a trailing forward slash to generated href attributes if the address is not a file (identified by absence of a "." character in href's basename).

4. Dependencies on Other Framework Components

  • Zend_View_Helper_HtmlElement
  • Zend_View_Helper_ServerUrl
  • Zend_View_Helper_BaseUrl

5. Theory of Operation

The component is a view helper that renders an HTML <base> tag, conforming to doctype specified using the Zend_View_Helper_Doctype helper.

An "href" attribute may be passed to the helper but in its absence, one is generated based on information from the Zend_View_Helper_ServerUrl and Zend_View_Helper_BaseUrl helpers.

An optional "target" attribute may also be passed to the helper.

6. Milestones / Tasks

  • Milestone 1: [DONE] Proposal finished
  • Milestone 2: Proposal accepted
  • Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
  • Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
  • Milestone 4: Unit tests exist, work, and are checked into SVN.
  • Milestone 5: Initial documentation exists.

7. Class Index

  • Zend_View_Helper_HeadBase

8. Use Cases

Default Options
Setting Base HREF
HREF and Target Attributes

9. Class Skeletons

Labels:
html html Delete
zend_view_helper zend_view_helper Delete
base base Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 25, 2010

    Interesting!

    The base tag is only allowed on head and should be named headBase.

    1. May 23, 2010

      Too true. Thanks for the suggestion

  2. Aug 05, 2010

    Hi Phil,

    All of the other headXxx helpers, allow for you to specify something in a view, and then later output it in a layout. Can you provide any usecase where this would be useful for this view helper?

    Also, what is the advantage of this over simply,

    in a layout file?

  3. Feb 08, 2011

    Archiving this proposal, feel free to recover it when you want to work on it again. For more details see this email.