PHP code example of geniv / nette-configurator

1. Go to this page and download the library: Download geniv/nette-configurator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

geniv / nette-configurator example snippets


protected function createComponentConfig(IConfigurator $configurator): IConfigurator
{
    // disable auto create ident
    //$configurator->setAutoCreate(false);
    return $configurator;
}

$this['config']->isEnable('ident'): bool;
$this['config']->getValue('ident'): mixed;

// echo value of ident
$this['config']->renderText('ident');
// return value of ident
$this['config']->renderText('ident', true);

// substitute logic
$this['config']->renderText('ident', null, 'arg');
$this['config']->renderText('ident', null, ['arg']);

// set data like translator
$this['config']->setTranslator('ident', 'text');
$this['config']->setEditor('ident', 'new text');

$this['config']->getDataByIdent('ident');
json
"php": ">=7.0",
"nette/nette": ">=2.4",
"dibi/dibi": ">=3.0",
"geniv/nette-locale": ">=2.0",
"geniv/nette-search-content": ">=1.0",
"geniv/nette-translator": ">=2.0"