Get panel version outside the panel

Does anyone of you know a way to get the panel version information outside the panel (e.g. in a template or plugin)?

Maybe a more elegant way than:

require 'panel/app/panel.php';
version_compare(panel::$version, '2.2.0')

Not quite happy about requiring the whole panel.php.

There’s no other way, because the Panel code is not loaded by Kirby. Loading the panel.php manually is least amount of code parsing required.

But I’d recommend using require_once to make sure you don’t accidentally load the file twice (which would result in an error).

1 Like