Opinion on how to turn on/off features in php

Mutsop used Ask the Experts™

I'm kinda stuck on how to create features and be able to turn them on or off per user.

So lets say:
each user has several api keys registered
each api registered has several gamecharacters

What I would like is let the user choose what features (connected to their api) they want to be active for each of their gamecharacters.

So a few questions:
How would I make sure the right api key is choosen?
Do i need to keep track of them in a database? if so how? as there are around 50 different features.

I'm using a php framework. So this will propably be set as a model
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Web Developer
First you will need to track with database so that you can know whether a particular user have active his gamecharacters or not. You must add api key in your database so that every time they activate and deactivate you can check for security. It will make sure that api key is correct or not when you store them in db.


@jagadishdulal Yes well I have already implemented a check on whether the character/api is his/hers.
But let's say you have features/methods like getBalance, getAssets, getShips, ...

How can I put them together so for example when I use checkboxes they can all be modified in a single click? Also, when I use one of these methods I have to create a new object. Is there a simple way to create just the object once and use them for all of the methods?


Found a way to select several features... thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial