Skip to content

Kirby 4.4.1

Helpers

Helper functions simplify common tasks or provide easy shortcuts to Kirby methods.

Deactivate a helper globally

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 false, e.g.

/index.php
<?php

define('KIRBY_HELPER_DUMP', false);

require __DIR__ . '/kirby/bootstrap.php';

echo (new Kirby)->render();

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.