You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adapt to codeigniter CI2 and CI3 using constructor init event more that one variables
* rename class and put a path structure
* update README with instructions
* change __construct to fith CI libraries policy
* the __construct can autodetects if were init with only the file
* support of array configuration
If you checked your `applications/config/config.php` will see how the line `$config['index_page'] = 'index.php';`
32
+
changed to `$config['index_page'] = 'index2.php';` magically!
29
33
30
-
***$config_file** (string) : The absolute path to the file where the array is declared.
31
-
***$variable_name** (string) : The variable name of the array to update.
32
-
***$auto_save** (boolean) : Whether the library should automatically save the changes.
33
34
34
-
We can start updating values:
35
+
## Configuration options
35
36
36
-
```
37
-
$config_writer->write('key' , value );
38
-
```
37
+
There are some configuration options which you can pass to the library in an associative array when you
38
+
performed in code `$this->configwriter->init($config)` or by constructor like `$this->load->library('ConfigWriter', $config);`
39
39
40
-
**Notes:**
41
-
*You can set value to any php variable type.
42
-
*The library treats numeric index "as is". Meaning '21' is different from 21
40
+
***file**: (string) This should be set to the file that you want to alter config array. It will default to `config.php`, each name will assume `applications/config/` as search path.
41
+
***variable_name** (string) : The variable name of the array to update. It will default to `$config`.as in file of codeignoter in `config.php`.
42
+
***auto_save** (boolean) : Whether the library should automatically save the changes. It will default to `TRUE`.
43
43
44
-
Supported variable Styles:
45
-
46
-
1. Single index
47
-
```php
48
-
$config[ 'key'] = 'value' ;
49
-
```
50
-
51
-
2. Multi dimensional
52
-
53
-
```php
54
-
$config['key1']['key2'] = 'value';
55
-
```
44
+
## USAGE
56
45
57
46
**note** You can not use the library to update the following format:
58
47
59
48
```php
60
49
$config = array( 'key' => 'value' );
61
50
```
62
-
63
-
**Notes:**
64
-
* The library expect the variable to be indexed.
65
-
* The file can have other variables aside our target variable.
0 commit comments