Understanding what belongs in controllers and in models

As a general rule, I would not put it into the snippets folder or if so, then only into a subfolder within snippets. I think the best place would indeed be the plugins folder or you could also put it into assets. If you wrap your code in a function and put it into /plugins, then your function is always accessible without the need to require it first.

1 Like