I need to get the assets URL in Kirby 2. When I opened the Cheat Sheet, I saw that I needed to use $urls->assets()
. However, when I tried to dump $urls
in my template, I got an error that it’s an undefined variable. After fiddling a bit, I saw that I have to get a reference to this object via $kirby->urls()
. So my question is where in the hell is that documented? I searched for a solid 15 minutes in the K2 archive and couldn’t find anything.
I see two problems:
- There’s no documentation for the
Kirby
object. - Objects like
$urls
and$roots
are not variables that can be used in templates, yet they are documented like that (with a dollar sign). It’s not mentioned how you obtain a reference to them.