Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
rudymadsen

Copy a module

Question

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

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Yes, it's possible. But dev experience is required

 

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites

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...