$kirby docs missing?


#1

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:

  1. There’s no documentation for the Kirby object.
  2. 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.

#2

Sorry for your frustration. As far as I can see, all the examples show how to call the methods, though?

45

We have changed how we document this in K3, so hopefully that is clearer now.


#3

Yeah, it’s true. But if you’re looking at the cheat sheet only, you don’t know where this $urls comes from. Anyway, I posted here because I thought there’s a problem with the K2 docs after K3 came in and the $kirby object docs were lost somewhere.

K3 docs are far better, yeah. I got used to them and they’re well structured. Good job on that!