How to check the October CMS version
3
Sometimes you need to use different logic depending on the October CMS version. Here is a way for you to check the exact version.
A simple way to check if it is v2 or above:
if (class_exists('System')) {
// Running October CMS 2.0 or above
}
else {
// Running October CMS 1.0
}
For more precise checking, this will check if it is v2.2 or above:
if (class_exists('System') && version_compare(\System::VERSION, '2.2') !== -1) {
// Running October CMS v2.2 or above
}
There are no comments yet
Be the first one to comment