Jump to content

Making Modules


cmgmyr

Recommended Posts

I've been working on an admin section that I've been using in a handful of websites so far. I have a structure that works pretty well so far. I would like some insight on how to make a "module". Right now I have a few options in my admin section:

- Catalog/Products

- Customers

- Orders

- Files

ect...

 

I would like to make these more modular...almost like a plugin where I can upload a directory into "plugins" or something like that and that whole plugin with function 100% (something like wordpress?).

 

Have you guys done something like this before? Any ideas? Suggestions? Problems?

 

Thanks!

-Chris

Link to comment
https://forums.phpfreaks.com/topic/73851-making-modules/
Share on other sites

I'm interested on it too, will be very helpful for me.

But it depends of  how you program your app, you must

program your app thinking that  you will put one plug in for the

app expect one plug in.

For example:

You must create the admin menu, you must think that if you

put some plug-in that menu will be automatically read the menu

from plug in too.

Link to comment
https://forums.phpfreaks.com/topic/73851-making-modules/#findComment-373338
Share on other sites

I mean, if you're familiar with object oriented programming a module can just be a class. You create the class one time... you do it right and then you have a "module" that can be plugged in and reused. Object oriented programming/designs promote the reuse of code much more so than sequential programming practices do.

 

That being said... depending on the application you can do it a lot of ways. For a lot of the stuff I've built in the past I've got one or more tables in a database for managing a certain part of an application (users, permissions, etc). I think write a class that "sits on top" of these tables and instead of writing queries against the database I'm calling functions.

 

$myObj->createUser('username','password','role');

 

Or something to that affect. I've shoved the implementation into the class and I'm able to abstract the details from the usage. To me doing this is one way to create reusable "modules." But it really depends on your application and what you're trying to accomplish.

Link to comment
https://forums.phpfreaks.com/topic/73851-making-modules/#findComment-373420
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.