Subactions Using One Class

I want to extend my controller to handle the following scenario:

I have two controllers: Contract and Subject; each of them has their own set of actions etc. Then each of these controllers will have a set of actions called "template" where the template has "view", "preview", "previewHtml", "generate" and will use the same logic with some slight name differences. So I searched in the internet and got into this article: which is almost what I am looking for but with one slight difference. I want to be able to call something like:

public function actions() {

	return [








and it will load all the template actions but they will belong to the the controller that loaded/called them. The reason I need this is because controller has a lot of behaviors that handle logs, rbac, some view related stuff and I need the actions to "belong" to the controller not just be their own module, controller, or action.

How can I achieve that? This needs to be an interface that can handle any "actionset"?