I have two pages let us call them UserView (UserView.page, UserView.php) and AdminView (AdminView.page, AdminView.php). That two pages have some different components and behaviours but also some common components and behaviour. So to avoid code duplication I want to put that common parts to separate files - let say: Common.tpl (derived from TTemplateControl) and Common.php. But I do not know how to include that Common file on UserView and AdminView.
There is template injection mechanism implemented by: TContent with TContentPlaceHolder but it works from other side: when there is one master and several child templates. In my situation that could works if I would make master from Common but it is not exactly what I want (and in that situation it would not be correct from logical point of view). For example if Common would be master I will get:
Common.page<!-- some common components -->
<com:TContentPlaceHolder ID="CommonPH" />
So now in both UserView and AdminView common components will be above specific commponents but I would like to have them in another place in UserView and AdminView.
I would like to have something like that:
UserView.page<!-- some UserView specific components -->
<!-- include Common components here -->
<!-- other UserView specific components -->
AdminView.page<!-- some AdminView specific components -->
<!-- include Common components here -->
<!-- other AdminView specific components -->
Is there a way to make inclusion like that?