Helpers
Helper functions simplify common tasks or provide easy shortcuts to Kirby methods.
-
asset()
-
attr()
-
collection()
-
csrf()
-
css()
-
deprecated()
-
dump()
-
e()
-
esc()
-
get()
-
gist()
-
go()
-
h()
-
html()
-
image()
-
invalid()
-
js()
-
kirby()
-
kirbytag()
-
kirbytags()
-
kirbytext()
-
kirbytextinline()
-
load()
-
markdown()
-
option()
-
page()
-
pages()
-
param()
-
params()
-
r()
-
router()
-
site()
-
size()
-
smartypants()
-
snippet()
-
svg()
-
t()
-
tc()
-
tt()
-
twitter()
-
u()
-
url()
-
video()
-
vimeo()
-
widont()
-
youtube()
Deactivate a helper globally
Since 3.7.0
Kirby tries to register its helper functions in PHP's global namespace. This can lead to conflicts when you or a plugin you are using is including other libraries that try to register their own functions globally with same names, e.g. dump()
. Kirby will throw an error when it detects this - so that this doesn't happen without your notice.
To deactivate one of Kirby's helper functions globally, you need to set a specific constant in your index.php
to true
, e.g.
The name of the corresponding constant is always KIRBY_HELPER_
+ name of the helper (uppercased). When you disable a helper function, it won't be registered anymore by Kirby.
As users might disable global helpers in their specific setups, it's recommended for plugin developers not to rely on the helper functions but rather use the corresponding class methods.