rudymadsen Posted March 19, 2020 Posted March 19, 2020 Is it possible to copy a module that I already is using for one purpose and use it for something different? I have a slider that I want to use for two different things, and I want to use the same module. Can I do that and how? Rudy Madsen
0 datakick Posted March 19, 2020 Posted March 19, 2020 Yes, it's possible. But dev experience is required
0 Traumflug Posted March 20, 2020 Posted March 20, 2020 Off the top of my head, these steps are required to duplicate a module: Duplicate the module folder. Give the new folder a meaningful name. Inside that folder is the main PHP file, same name as the folder, plus .php suffix. Rename this to the new folder name. This main PHP file defines a class making up the module. In its constructor, a variable/property '$this->name', change that to the new name as well. Delete all files starting with 'config' and ending with '.php', they'll get recreated automatically. That said, duplication makes no sense for some modules. For example, modules defining a database table; the module copy would use the same database or require more substantial coding efforts.
Question
rudymadsen
Is it possible to copy a module that I already is using for one purpose and use it for something different? I have a slider that I want to use for two different things, and I want to use the same module. Can I do that and how?
Rudy Madsen
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