So both concepts are useful, however what is their distinction really?
With a Controller the documentation implies it is a way to return attributes for your page that are not as straight forward as listing them in the page.txt (articles/pagination).
With the Page Model it extends the Page object but the documentation shows a simple example of adding an extra attribute (cover in this case).
However both situations can be accomplished using either method.
So what is the preferred method? Or are they both to be used for different things?
For example I have a blog.php that currently is “the kitchen sink” and I am now separating its parts into Snippets, and whatnot.
In that blog.php I have a large chunk of PHP code at the top to collect together a lot of common information into PHP variables and also create two arrays of information. I do this so I do not have to keep querying Kirby every time I want to obtain some information.
So what should I use? Or should I be using both of them for different things?
Controllers and page models serve different purposes and there scope is different as well.
While controllers are only accessible from the templates with the same name, the methods of page models are also accessible from other templates that reference the page as well.
In your controllers, you put the logic - or the data - for your templates, thus keeping the template easier to read. So instead of defining your variables in the template, you do that in the controller, e.g.
The page model, however, is useful if you want to define new page methods for your templates or if you want to overwrite/extend existing page methods. Typically, it makes sense to put a method into a page model, if it is used several times in a template or if you need a special function, i.e. a calculation.
For use cases of page models, you can search this forum a bit, e.g. this thread or this