Download the PHP package bushbaby/bsb-localized-template-path-stack without Composer

On this page you can find all versions of the php package bushbaby/bsb-localized-template-path-stack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bsb-localized-template-path-stack

BsbLocalizedTemplatePathStack

BsbLocalizedTemplatePathStackResolver is a small ZF2 module that provides a template path stack resolver to load templates named to the active locale.

Installation

as zf2 project

BsbLocalizedTemplatePathStackResolver works with Composer. To install it into your project, just add the following line into your composer.json file:

"require": {
    "bushbaby/bsb-localized-template-path-stack-resolver": "*"
}

Then update your project by runnning composer.phar update.

Finally enable the module by adding BsbLocalizedTemplatePathStackResolver in your application.config.php file.

as standalone

For development purposes you might want to install BsbLocalizedTemplatePathStackResolver standalone. Clone the project somewhere on your computer

git clone [email protected]:bushbaby/BsbLocalizedTemplatePathStack.git BsbLocalizedTemplatePathStack
cd BsbLocalizedTemplatePathStack
curl -sS https://getcomposer.org/installer | php
git checkout develop
./composer.phar install
phpunit

Configuration

To configure the module just copy the bsb_localized_template_path_stack.local.php.dist (you can find this file in the config folder of BsbLocalizedTemplatePathStack) into your config/autoload folder, and override what you want.

Note that the resolver is attached after the zend resolvers. This means that it will be only visited when those fail to resolve to a template.

The the resolver is automaticly configured with the paths supplied in the view_manager['template_path_stack'] option and it are these paths that are used to look for a localized version of a template.

Options

fallback_locale string, defaults to null

The resolver will use this locale as fallback locale when primary locale will not resolve.

Note: When the value is not a string, the factory will get the application translator and use its fallback locale. The second value in the translator locale option represents the fallback locale within the application translator.

name_conversion_pattern string, defaults to '#DIRNAME#/#FILENAME#/#LOCALE#.#EXTENSION#'

This pattern is used to look for a template.

Example

Given a directory structure and a template name of 'application/index' the default pattern will be able to succesfully resolve a template if the current locale is one of nl_NL, de_DE or en_UK.

view
  application
    index
      index
        nl_NL.phtml
        de_DE.phtml
        en_UK.phtml

Given a directory structure and a template name of 'application/index' the conversion pattern should be changed to '#DIRNAME#/#LOCALE#/#FILENAME#.#EXTENSION#'.

view
  application
    index
      nl_NL
        index.phtml
      de_DE
        index.phtml
      en_UK
        index.phtml

This will resolve to application/index/nl_NL.phtml when the current locale is nl_NL. When the current locale is en_US resolving will fail unless a fallback locale has been set (to one of the provided templates).


All versions of bsb-localized-template-path-stack with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
ext-intl Version *
zendframework/zend-mvc Version >=2.2.2
zendframework/zend-servicemanager Version >=2.2.2
zendframework/zend-view Version >=2.2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bushbaby/bsb-localized-template-path-stack contains the following files

Loading the files please wait ....