options
implements a simple application options container class of sorts. Basically you can store your application options in the database easily using this class. You will need to create a table with the following structure in order for this class to work.
CREATE TABLE IF NOT EXISTS options
(
id
int(11) NOT NULL AUTO_INCREMENT,
option_name
varchar(100) NOT NULL,
option_value
varchar(2048) NOT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Parent Class
None
Static Properties
Data Type: string
Default Value: options
table
table. You really shouldn’t need access to this under normal circumstances.Data Type: table
Static Methods
$key
from the options database tableParameters:
$key
(string) is the name of the option key or false if the key does not existReturns:
(string) value associated with the specified
$key
Example:
1 |
$skin = \ipinga\options::get('skin'); |
$key
Parameters:
$key
(string) is the name of the option key$value
(string) is the value to store associated with the keyReturns:
(string) The prior value for the specified key or false if there was no prior value
Example:
1 |
$oldSkin = \ipinga\options::set('skin','cupertino'); |