application icon indicating copy to clipboard operation
application copied to clipboard

Added $templateFile to UI\Control

Open holantomas opened this issue 7 years ago • 5 comments

  • 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

holantomas avatar Dec 10 '18 15:12 holantomas

I prefer a higher level abstraction which would use views instead of specific templates, similarly like presenters do.

mabar avatar Dec 10 '18 18:12 mabar

@mabar I'm OK with that :+1: If more people will consider it as good way I can try to implement it.

holantomas avatar Dec 10 '18 18:12 holantomas

I think you cannot as it requires more than ITemplate interface

mabar avatar Dec 10 '18 19:12 mabar

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?

milo avatar Dec 11 '18 16:12 milo

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.

holantomas avatar Dec 11 '18 17:12 holantomas