Link to home
Start Free TrialLog in
Avatar of Mutsop
MutsopFlag for Belgium

asked on

Opinion on how to turn on/off features in php

Hi,

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
ASKER CERTIFIED SOLUTION
Avatar of Jagadishwor Dulal
Jagadishwor Dulal
Flag of Nepal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mutsop

ASKER

@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?
Avatar of Mutsop

ASKER

Found a way to select several features... thanks