Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_View_Helper_HeadTitle Class Reference

Extends the head title helper to insert a separator between the prefix/postfix and the title. More...

Inheritance diagram for P4Cms_View_Helper_HeadTitle:
P4Cms_View_Helper_BodyTitle

List of all members.

Public Member Functions

 toString ($indent=null, $locale=null)
 Turn helper into string - overrides parent to put the separator between title parts and prefix/postfix.

Protected Member Functions

 _stripTitleTag ($output)
 Strip title tag from output.

Protected Attributes

 $_regKey = 'P4Cms_View_Helper_HeadTitle'

Detailed Description

Extends the head title helper to insert a separator between the prefix/postfix and the title.

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_HeadTitle::_stripTitleTag ( output) [protected]

Strip title tag from output.

Parameters:
string$outputthe output to strip title tags from
    {
        return preg_replace('/<\/?title>/i', '', $output);
    }
P4Cms_View_Helper_HeadTitle::toString ( indent = null,
locale = null 
)

Turn helper into string - overrides parent to put the separator between title parts and prefix/postfix.

Parameters:
string | null$indenthow much to indent the output
string | null$localethe locale to inform translation
Returns:
string the head title in a title tag.

Reimplemented in P4Cms_View_Helper_BodyTitle.

    {
        $indent = (null !== $indent)
                ? $this->getWhitespace($indent)
                : $this->getIndent();

        $items = array();

        if ($this->_translate && $translator = $this->getTranslator()) {
            foreach ($this as $item) {
                $items[] = $translator->translate($item, $locale);
            }
        } else {
            foreach ($this as $item) {
                $items[] = $item;
            }
        }

        $separator = $this->getSeparator();
        $output = '';
        if (($prefix = $this->getPrefix())) {
            array_unshift($items, $prefix);
        }
        if (($postfix = $this->getPostfix())) {
            array_push($items, $postfix);
        }
        $output .= implode($separator, $items);

        $output = ($this->_autoEscape) ? $this->_escape($output) : $output;

        return $indent . '<title>' . $output . '</title>';
    }

Member Data Documentation

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

Reimplemented in P4Cms_View_Helper_BodyTitle.


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