Class autoloading not working – after adding new class into nette/forms:^3.1.9-RC
- m.brecher
- Generous Backer | 864
Hi everybody !
I wish a happy New Year and sorry for disturbing your holiday, but I have a problem:
I have done little testing of nette/forms:^3.1.9-RC and found some little cases where small improving may be useful. To make some necessary testing I have created new class of new form input control for date directly in directory of nette forms. The autoloading of this new class doesn´t work, but it was possible to fix it with include. See the extract of the code below:
namespace Nette\Forms;
.....
class Container extends Nette\ComponentModel\Container implements \ArrayAccess
{
.......
public function addDate(.....): Controls\DateInput // added new method - works ok
{
include __DIR__.'/Controls/DateInput.php'; /* fix of not-working autoloading */
return $this[$name] = (new Controls\DateInput($label)) ..... ;
}
}
new added class in \vendor\nette\forms\src\Forms\Controls\DateInput.php
namespace Nette\Forms\Controls;
......
class DateInput extends TextInput
{
........
}
I expect, that it is simply not possible to modify the source code of Nette in such straightforward way. Could somebody advice me the correct procedure ?
Thanks
- mystik
- Member | 308
Btw if you want DateTimeInput you can check this https://github.com/…ols/DateTime
- m.brecher
- Generous Backer | 864
@mystik
Btw if you want DateTimeInput you can check this https://github.com/…ols/DateTime
Thanks for this advice, I see some imperfections in the current set of form inputs, I will try.