Get singletons by custom API

#1

Hey!
I use with:

cockpit(‘collections’)->find(‘menu’);

To get the menu collections but I also want to get some singletons,
I tried:

cockpit(‘singletons’)->find(‘homepage’)

but I got null, how can I get the singletons?
And also be nice to get link to full cockpit documentation, because https://getcockpit.com/documentation not really help me :slight_smile:

#2

Singletons don’t have a find function. Use cockpit('singletons')->getData('homepage') instead.

PS: For code blocks you can use back-ticks https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code

1 Like
#3

Thank You very much!