pikl-cz/config-params

获取Nette应用程序上下文信息。

1.0.0 2017-05-10 08:55 UTC

This package is not auto-updated.

Last update: 2024-09-23 16:16:40 UTC


README

获取Nette应用程序当前模式。

安装

composer require pikl-cz/config-params

在config.neon中的实现

extensions:
    - Pikl\DI\ConfigParamsExtension

使用

use Pikl\ConfigParams;

class BasePresenter extends Nette\Application\UI\Presenter {

	/** @var Pikl\ConfigParams */
	public $configParams;
	
	public function injectConfigParams(ConfigParams $configParams) {
        	$this->configParams = $configParams;
    	}

	function startup() {
		parent::startup();
		$this->template->debugMode = $this->configParams->getDebugMode();
	}

}