2017 © Pedro Peláez
 

library rt-headtitle

ZF2 Plugin to set title easily to your pages from controllers actions

image

remithomas/rt-headtitle

ZF2 Plugin to set title easily to your pages from controllers actions

  • Friday, March 29, 2013
  • by remithomas
  • Repository
  • 0 Watchers
  • 3 Stars
  • 2,480 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

rt-headtitle

ZF2 HeadTitle plugin, you can easily set any title within yours controllers actions, (*1)

Features / Goals

  • Set and manage your titles from controllers actions

How to install ?

Using composer.json

{
    "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"
    }
}

Activate the module :

application.config.php, (*2)

<?php
return array(
    'modules' => array(
        'Application',
        'RtHeadtitle',
    )
);
?>

Only activated in one module

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), (*3)

<?php
return array(
    'controller_plugins' => array(
        'invokables' => array(
            'HeadTitle' => 'RtHeadtitle\Controller\Plugin\HeadTitle',
        )
    ),
    ...

Activated for all the application

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/, (*4)

Change your Layout.phtml

<html lang="en">
    <head>
      <?php echo $this->headTitle(); ?>
    </head>
    <body>content</body>
</html>

How to use ?

How to use in your controller action !

public function indexAction(){
    $this->headTitle("My website")->setSeparator(" - ")->append("easy ?!");
    return new ViewModel();
}

The Versions

29/03 2013

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/remithomas/rt-headtitle

ZF2 Plugin to set title easily to your pages from controllers actions

  Sources   Download

The Requires

 

zf2 title headtitle

29/03 2013

dev-master

9999999-dev https://github.com/remithomas/rt-headtitle

ZF2 Plugin to set title easily to your pages from controllers actions

  Sources   Download

The Requires

 

zf2 title headtitle