Closed iskrisis closed 3 years ago
I can make the PR after your opinion.
I agree. moduleName
and moduleId
can definitely be moved to the ModulePage model.
I'm not sure about renderModules
because I would use it on the parent page (which has a modules
child and multiple module
grandchildren) whose template (and model) could be anything. We could use global a ->modules()
page method and use the renderModules
method on the modules container only.
You are totally right i haven't realized that there is modules page between.
I think we should be careful where we put methods.
'pageMethods' applies methods to all page templates and thats pretty global. I think with some of the methods it doesn't make much sense to have them global and should be on the pageModel instead (especially since we have them).
So the question is from
'renderModules'
,'isModule'
,'moduleName'
,'moduleId'
which are useful on any page.I would say
'isModule'
always returns something useful.'renderModules'
could be just on modules model but it doesn't do anything bad so it might also make sense to have them global.'moduleName'
and'moduleId'
i think belong only to ModulePage model.We have to think about about every method where it should belong in future aswell.