netleak/config-params

Getters to find out in which modes are the Nette application.

1.3.8 2024-09-04 08:55 UTC

This package is auto-updated.

Last update: 2024-11-04 09:24:37 UTC


README

Getters to find out in which modes are the Nette application.

Installation

composer require netleak/config-params

Write this to config.neon

extensions:
    - Netleak\DI\ConfigParamsExtension

Usage

use Netleak\ConfigParams;

class BasePresenter extends Nette\Application\UI\Presenter {

	public ConfigParams $configParams;
	
	public function injectConfigParams(ConfigParams $configParams): void {
        	$this->configParams = $configParams;
    	}

	function startup() {
		parent::startup();
		$this->getTemplate()->setParameters(array('debugMode' => $this->configParams->getDebugMode()));
	}

}