Jump to content
thirty bees forum

Question

Posted

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

  • 0
Posted

Off the top of my head, these steps are required to duplicate a module:

  1. Duplicate the module folder.
  2. Give the new folder a meaningful name.
  3. Inside that folder is the main PHP file, same name as the folder, plus .php suffix. Rename this to the new folder name.
  4. 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.
  5. 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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...