add a meaningful title to HTML-pages (Issue #185)

This commit is contained in:
coderkun 2014-05-04 01:41:54 +02:00
commit dde0a50e04
22 changed files with 334 additions and 39 deletions

View file

@ -31,6 +31,12 @@
* @var array
*/
public static $user = null;
/**
* Title information
*
* @var array
*/
private $title = array();
@ -92,6 +98,56 @@
}
/**
* Return current title information.
*
* @return string Title information
*/
public function getTitle()
{
return $this->title;
}
/**
* Add a piece of information to the current title.
*
* @param string $title Title information
*/
protected function addTitle($title)
{
$this->title[] = $title;
}
/**
* Add a piece of information to the current title and localize
* it.
*
* @param string $title Title information
*/
protected function addTitleLocalized($title)
{
$title = gettext($title);
$args = func_get_args();
if(count($args) > 0) {
$title = call_user_func_array(
'sprintf',
array_merge(
array($title),
array_slice($args, 1)
)
);
}
$this->title[] = $title;
}
/**