geniv / nette-configurator
Configurator and translator component for Nette Framework
Installs: 1 162
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- dibi/dibi: >=3.0
- geniv/nette-locale: >=2.0
- geniv/nette-search-content: >=1.0
- geniv/nette-translator: >=2.0
- nette/nette: >=2.4
- dev-master
- v4.2.8
- v4.2.7
- v4.2.6
- v4.2.5
- v4.2.4
- v4.2.3
- v3.2.3
- v3.2.2
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.1
- v3.0.0
- v2.2.1
- v2.2.0
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0
- dev-develop
This package is auto-updated.
Last update: 2024-10-18 04:45:46 UTC
README
Installation
$ composer require geniv/nette-configurator
or
"geniv/nette-configurator": "^4.0"
require:
"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"
Include in application
available source drivers:
- DevNullDriver (default values)
- DibiDriver (dibi + cache
_Configurator-DibiDriver
)
self translator class:
- ConfiguratorTranslator (cache
_Configurator-ConfiguratorTranslator
)
neon configure:
# configurator configurator: # debugger: true # autowired: true # driver: Configurator\Drivers\DevNullDriver driver: Configurator\Drivers\DibiDriver(%tablePrefix%) translator: false # searchMask: # - *Translation.neon searchPath: - %appDir%/presenters/AppTranslation.neon # excludePath: # - CustomExcludeTranslation.neon
neon configure extension:
extensions: configurator: Configurator\Bridges\Nette\Extension
description
internal combination id_ident
and id_locale
must by unique! type content is only like "category" or "flag of type"
Internal data are loading in first usage component.
Available interface: IConfigurator
usage:
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');
usage:
{control config:text 'web-title'} {control config:text 'web-title', true} {control config:text 'web-title', null, 'argument'} {control config:text 'web-title', null, ['argument']} <h1 n:if="$presenter['config']->isEnable('web-title')">{control config:text 'web-title'}</h1> <h1 n:if="$presenter['config']->getValue('show-web-title')">{control config:text 'web-title'}</h1> {* long equivalent - WHY?!: *} <h1 n:if="$presenter['config']->renderCheckbox('show-web-title', true)">{control config:text 'web-title'}</h1>