Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_View_Helper_BodyTitle Class Reference

Essentially the head title helper under a different name. More...

Inheritance diagram for P4Cms_View_Helper_BodyTitle:
P4Cms_View_Helper_HeadTitle

List of all members.

Public Member Functions

 bodyTitle ($title=null, $setType=null)
 Expose the head title helper under a different name.
 toString ($indent=null, $locale=null)
 Turn helper into string - overrides parent to strip the title tag and fall back to the head title if no body title has been set.

Protected Member Functions

 _getLeadingHeadTitle ()
 Get the first component of the head title.

Protected Attributes

 $_regKey = 'P4Cms_View_Helper_BodyTitle'

Detailed Description

Essentially the head title helper under a different name.

Falls back to the first component of the headTitle helper if no body title is explicitly set.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

P4Cms_View_Helper_BodyTitle::_getLeadingHeadTitle ( ) [protected]

Get the first component of the head title.

Returns:
string the leading head title.
    {
        $headTitle = $this->view->getHelper('headTitle');
        foreach ($headTitle as $title) {
            return $title;
        }

        return '';
    }
P4Cms_View_Helper_BodyTitle::bodyTitle ( title = null,
setType = null 
)

Expose the head title helper under a different name.

Parameters:
string$titlea title to set.
string$setTypewhether to set, prepend or append the title.
Returns:
Zend_View_Helper_HeadTitle provides fluent interface.
    {
        return parent::headTitle($title, $setType);
    }
P4Cms_View_Helper_BodyTitle::toString ( indent = null,
locale = null 
)

Turn helper into string - overrides parent to strip the title tag and fall back to the head title if no body title has been set.

Parameters:
string | null$indenthow much to indent the output
string | null$localethe locale to inform translation
Returns:
string the body title.

Reimplemented from P4Cms_View_Helper_HeadTitle.

    {
        $output = $this->_stripTitleTag(parent::toString($indent, $locale));
        if (!$output) {
            $output = $this->_getLeadingHeadTitle();
            $output = ($this->_autoEscape) ? $this->_escape($output) : $output;
        }

        return $output;
    }

Member Data Documentation

P4Cms_View_Helper_BodyTitle::$_regKey = 'P4Cms_View_Helper_BodyTitle' [protected]

Reimplemented from P4Cms_View_Helper_HeadTitle.


The documentation for this class was generated from the following file: