Welcome Guest, Not a member yet? Register   Sign In
Toggling With Radio Buttons Config Class
#1

[eluser]riwakawd[/eluser]
I just have a idea and would like to know if possible.

I have two radio buttons on my settings which one is yes and other is no. Yes button updates the database as 1. And no update database as 0.

On my config.php file I have $config['maintenance'] = TRUE; or $config['maintenance'] = FALSE; Currently set to TRUE.

I would like to be able to use my form to change the database value which can do but also change that config item. At same time.

What would be your suggestion to do so? Just would like them to both work together.
#2

[eluser]Tim Brownlaw[/eluser]
So you are using the DB to remember the state of the change you want to make to the config file.
In which you would need to read, update and write back the config file.
Or you can have a copy and switch it over... Which is a bad idea!

Either way you are performing a Read and test that you are in maintenance mode or not and doing something...... So making changes to your config file is a lot of bother...

So why not just read the state of the DB Setting and act accordingly to the value it's set to?

Just having a Maintenance mode check - requires that you do "Something" to check and take action. Why not make it simple on yourself.

I'm also not big on having two radio buttons to perform an ON/OFF operation. Thats a litle like having two light switches... One to turn the light on and another to turn the light off...

A Radio or Checkbox is either in an On or Off state... so why not just use that!

#3

[eluser]riwakawd[/eluser]
[quote author="Tim Brownlaw" date="1410679376"]So you are using the DB to remember the state of the change you want to make to the config file.
In which you would need to read, update and write back the config file.
Or you can have a copy and switch it over... Which is a bad idea!

Either way you are performing a Read and test that you are in maintenance mode or not and doing something...... So making changes to your config file is a lot of bother...

So why not just read the state of the DB Setting and act accordingly to the value it's set to?

Just having a Maintenance mode check - requires that you do "Something" to check and take action. Why not make it simple on yourself.

I'm also not big on having two radio buttons to perform an ON/OFF operation. Thats a litle like having two light switches... One to turn the light on and another to turn the light off...

A Radio or Checkbox is either in an On or Off state... so why not just use that!

[/quote]

Cheers for ideas




Theme © iAndrew 2016 - Forum software by © MyBB