Skip to the content
Documentation

exp_environment

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

The template operators exp_environment() and exp_environment_badge() The name comes from the EXP_ENV constant in config.env.php, see eZINI::environment().

Description

The template operators exp_environment() and exp_environment_badge()

The name comes from the EXP_ENV constant in config.env.php, see
eZINI::environment(). Without a valid environment the operator returns an
empty string, so a template can test it directly:
exp_environment_badge() returns the environment badge of the administration
(site.ini [AdminEnvironment], see badge()) as a hash: level, name, short,
release, display, title and key. Without a level, level is an empty string and the
administration shows no badge.

Examples

{if eq( exp_environment(), 'test' )}<div class="test-site-banner">Test site</div>{/if}

Source

Implemented by expEnvironmentOperator (kernel/common/expenvironmentoperator.php).

See also

Generated example: exp_environment

Added to the reference for Exponential 6.0.15: the 4.x reference had no page for this operator.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.