2017 © Pedro Peláez
 

library bsb-translate-controller-plugin

BsbTranslateControllerPlugin is a ZF2 module that provides controller plugin to expose the translator.

image

bushbaby/bsb-translate-controller-plugin

BsbTranslateControllerPlugin is a ZF2 module that provides controller plugin to expose the translator.

  • Thursday, April 3, 2014
  • by bushbaby
  • Repository
  • 1 Watchers
  • 2 Stars
  • 914 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

BsbTranslateControllerPlugin

BsbTranslateControllerPlugin is a small ZF2 module that registers a translator as controller plugin., (*1)

Installation

BsbTranslateControllerPlugin works with Composer. To install it into your project, just add the following line into your composer.json file:, (*2)

"require": {
    "bushbaby/bsb-translate-controller-plugin": "~1.0.0"
}

Then update your project by runnning composer.phar update., (*3)

Finally enable the module by adding BsbTranslateControllerPlugin in your application.config.php file., (*4)

Usage

Within an action controller you as plugins would use the translate and translatePlural view helpers., (*5)

Instead of using something ugly as;, (*6)

$helper = $this->getServiceLocator()->get('viewhelpermanager')->get('translate');
echo $helper('message');

Use this;, (*7)

echo $this->translate('message');

Instead of using something ugly as;, (*8)

$helper = $this->getServiceLocator()->get('viewhelpermanager')->get('translateplural');
echo sprintf($helper('%s message', '%s messages', $number), $number);

Use this;, (*9)

echo sprintf($this->translatePlural('%s message', '%s messages', $number), $number);

The Versions

03/04 2014

dev-master

9999999-dev https://github.com/bushbaby/BsbTranslateControllerPlugin

BsbTranslateControllerPlugin is a ZF2 module that provides controller plugin to expose the translator.

  Sources   Download

MIT

The Requires

 

plugin zf2 module translation i18n

03/04 2014

1.0.2

1.0.2.0 https://github.com/bushbaby/BsbTranslateControllerPlugin

BsbTranslateControllerPlugin is a ZF2 module that provides controller plugin to expose the translator.

  Sources   Download

MIT

The Requires

 

plugin zf2 module translation i18n

03/04 2014

dev-develop

dev-develop https://github.com/bushbaby/BsbTranslateControllerPlugin

BsbTranslateControllerPlugin is a ZF2 module that provides controller plugin to expose the translator.

  Sources   Download

MIT

The Requires

 

plugin zf2 module translation i18n

29/10 2013

1.0.1

1.0.1.0 https://github.com/bushbaby/BsbTranslateControllerPlugin

BsbTranslateControllerPlugin is a ZF2 module that provides controller plugin to expose the translator.

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin zf2 module translation i18n

11/10 2013

1.0.0

1.0.0.0 https://github.com/bushbaby/BsbTranslateControllerPlugin

BsbTranslateControllerPlugin is a ZF2 module that provides controller plugin to expose the translator.

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin zf2 module translation i18n