Added $templateFile to UI\Control
- new feature
- BC break? no (3rd party apps maybe ...?)
- doc PR: not needed
I made topic for this on forum: https://forum.nette.org/en/31591-ui-control-templatefile
I prefer a higher level abstraction which would use views instead of specific templates, similarly like presenters do.
@mabar I'm OK with that :+1: If more people will consider it as good way I can try to implement it.
I think you cannot as it requires more than ITemplate interface
IMHO, template file is internal thing of Control, thing of encapsulation. Control may use more templates too, that's why you usualy set template file in render() method.
Why do you need set template file outside of Control?
IMHO, template file is internal thing of Control, thing of encapsulation. Control may use more templates too, that's why you usualy set template file in
render()method.Why do you need set template file outside of Control?
It's shown in forum topic. User usign 3rd party control like datagrid or paginator but HTML not equal to his UI for example.
encapsulation:
Control::getTemplate(): ITemplate is public
ITemplate::setFile() is public
This doesn't break anything.
And I'm not sure but settings template file in render() is to prevent unnecessary creating template or prevent creating template before Control is attached to presenter I think. Both doing my PR too.