The first example requires at least Kirby 3.6.2, while the second example works with 3.6.x and higher.
There are already a lot of ways you can customize Kirby by adding custom methods, overwrite core components, extend the Page class with your own model, and a …