Adik Posted February 29 Posted February 29 (edited) I'm using Bootstrap 5.1 in my theme, so I need to replace data-dismiss by data-bs-dismiss in file /classes/module/Module.php So I created a file Module.php in /override/classes/: <?php class ModuleOverride extends Module { public function displayConfirmation($string) { // Fix Bootstrap 5, added: data-bs-dismiss $output = ' <div class="bootstrap"> <div class="module_confirmation conf confirm alert alert-success"> <button type="button" class="close" data-bs-dismiss="alert">×</button> '.$string.' </div> </div>'; return $output; } public function displayError($error) { // // Fix Bootstrap 5, added: data-bs-dismiss $output = ' <div class="bootstrap"> <div class="module_error alert alert-danger" > <button type="button" class="close" data-bs-dismiss="alert">×</button>'; if (is_array($error)) { $output .= '<ul>'; foreach ($error as $msg) { $output .= '<li>'.$msg.'</li>'; } $output .= '</ul>'; } else { $output .= $error; } // Close div opened previously $output .= '</div></div>'; return $output; } } unfortunately override is not loaded. When I edited directly file Module.php in /classes/module/ fix works. Deleted cache folder and file class_index.php. I also copy file Module.php to /override/classes/module/, but it didn't help. It's possible to override Module.php? Edited February 29 by Adik
0 datakick Posted February 29 Posted February 29 You have to use correct name for your override, otherwise system will not use it: class Module extends ModuleCore { ... } 1 1
Question
Adik
I'm using Bootstrap 5.1 in my theme, so I need to replace
by
in file /classes/module/Module.php
So I created a file Module.php in /override/classes/:
unfortunately override is not loaded.
When I edited directly file Module.php in /classes/module/ fix works.
Deleted cache folder and file class_index.php.
I also copy file Module.php to /override/classes/module/, but it didn't help.
It's possible to override Module.php?
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now