ZF2 HeadTitle plugin, you can easily set any title within yours controllers actions
- Set and manage your titles from controllers actions
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"minimum-stability": "dev",
"homepage": "http://framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "dev-master",
"remithomas/rt-headtitle": "dev-master"
}
}
application.config.php
<?php
return array(
'modules' => array(
'Application',
'RtHeadtitle',
)
);
?>
If you need to use this plugin only in one module. Just copy this code and add it into your own module config (module.config.php)
<?php
return array(
'controller_plugins' => array(
'invokables' => array(
'HeadTitle' => 'RtHeadtitle\Controller\Plugin\HeadTitle',
)
),
...
If you need to use this plugin in all your application. Just copy the file rt-headtitle.global.php.dist (/vendor/remithomas/rt-headtitle/config/) and paste it into the folder /config/autoload/
<html lang="en">
<head>
<?php echo $this->headTitle(); ?>
</head>
<body>content</body>
</html>
public function indexAction(){
$this->headTitle("My website")->setSeparator(" - ")->append("easy ?!");
return new ViewModel();
}