bazo/nette-features-extension

Feature toggler extension for Nette Framewrok

Installs: 6 796

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/bazo/nette-features-extension

dev-master 2018-09-27 18:34 UTC

This package is not auto-updated.

Last update: 2025-09-27 22:17:43 UTC


README

Feature toggling library for php

usage:

register extension

extensions:
	features: Bazo\FeatureToggler\DI\FeaturesExtension

configure features, for more information see https://github.com/bazo/feature-toggler#feature-toggler

features:
	features:
		globals:
			ip: %remoteIp%
		analytics:
			conditions:
				- {ip, in, %remoteIps%}
		zopim:
			conditions:
				- {ip, in, %remoteIps%}
		facebook-like:
			conditions:
				- {ip, in, %remoteIps%}
		login:
			conditions:
				- {ip, in, %allowedIps%}
		registration:
			conditions:
				- {ip, in, %allowedIps%}
		membership:
			active: FALSE

in latte you can use macros:

{ifEnabled feature $context} or {ifEnabled feature [username => bazo]}
feature is enabled
{else}
not enabled
{/ifEnabled}

or n-macros:

<div n:ifEnabled="feature $context">
feature is enabled
</div>

there's also the not enabled alternative ifNotEnabled