Extend form container via neon
- Pavel Kravčík
- Member | 1195
Hey, is it possible replace this by “clear neon way” without PHP code? Ofcourse I can do it via Compiler extension, but is another possibility?
\Code\Component\Form::extensionMethod(
'addCurrency',
function(\Nette\Forms\Container $container, $name, $title = 'currencyInput') {
return $container[$name] = new \Scania\Extension\CurrencyInput($title);
}
);
Something like:
form:
extension:
addCurrency: ClassPath
- Felix
- Nette Core | 1196
I think it's nice idea, do you mind to implement it to contributte/forms? I can also do it by myself.
@PavelKravčík
Last edited by Felix (2018-03-31 12:07)
- Pavel Kravčík
- Member | 1195
I have already put to “some-longterm-sugar-todo”. So when I implement this I can share solution to contributte.