Extend form container via neon

6 months ago

Pavel Kravčík
Member | 913
+
0
-

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

6 months ago

David Grudl
Nette Core | 6766
+
0
-

No.

6 months ago

Pavel Kravčík
Member | 913
+
0
-

K, thx.

6 months ago

Felix
Nette Core | 864
+
0
-

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)

6 months ago

Pavel Kravčík
Member | 913
+
0
-

I have already put to “some-longterm-sugar-todo”. So when I implement this I can share solution to contributte.