Q:

Get page title from Zend's headTitle()

In ZF2, I'm setting the page title using:
$title = 'Sign In';
$this->headTitle($title);

And in the layout.phtml, this is used to generate the title element in the header:
echo $this->headTitle('SalesCom')->setSeparator(' - ')->setAutoEscape(false);

How would I then be able to get just the $title from within the layout.phtml to set a page title within the body itself?

A:

The HeadTitle helper actually implements ArrayAccess, so you can simply do something like this:
$title = $this->headTitle();
$part  = $title[0];

If you have PHP 5.4, it's even better:
$part = $this->headTitle()[0];

