04-08-2019, 12:00 PM
Hi all! I'd like to share my final CodeIgniter 3 library, fully rewritten for CI4 and ready to use. As with all my libraries, it's "configuration lite" so read the docs at GitHub, plug it in, and go.
Tatter/Settings - plug-and-play settings management for CodeIgniter 4
Basic usage:
1. Install with Composer: `> composer require tatter/settings`
2. Update the database: `> php spark migrate:latest -all`
3. Add settings: `> php spark settings:add timezone user America/New_York`
4. Load the service: `$settings = service('settings');`
5. Get/set settings per user:
Once the library is included all the resources are ready to go and you are ready to start adding settings. You may import setting templates directly into the `settings` table or add them manually with the provided CLI command: `> php spark settings:add`
Settings take one of three scopes: session, user, global.
In addition to the five libraries I have ported (and the original 'Audits') I have two CI3 libraries I never completed: 'Notices' (a user communication gateway) and 'Plots' (a sitemap generator and route analyzer). Please let me know if you'd find interest in these for CI4.
As always I am eager for feedback, suggestions, and contributions - feel free to respond here or on GitHub (https://github.com/tattersoftware/codeigniter4-settings). Thanks for reading!
Thanks for reading!
Tatter/Settings - plug-and-play settings management for CodeIgniter 4
Basic usage:
1. Install with Composer: `> composer require tatter/settings`
2. Update the database: `> php spark migrate:latest -all`
3. Add settings: `> php spark settings:add timezone user America/New_York`
4. Load the service: `$settings = service('settings');`
5. Get/set settings per user:
PHP Code:
$settings->timezone = $_POST['timezone_preference'];
...
$userTimezone = $settings->timezone;
Once the library is included all the resources are ready to go and you are ready to start adding settings. You may import setting templates directly into the `settings` table or add them manually with the provided CLI command: `> php spark settings:add`
Settings take one of three scopes: session, user, global.
- Global settings are the same for every user and provide a dynamic way to set application-wide values
- User settings start with a default template value but each user may make their own default that persists across sessions
- Session settings start with a default template value and may be changed by a user but revert for each new session
In addition to the five libraries I have ported (and the original 'Audits') I have two CI3 libraries I never completed: 'Notices' (a user communication gateway) and 'Plots' (a sitemap generator and route analyzer). Please let me know if you'd find interest in these for CI4.
As always I am eager for feedback, suggestions, and contributions - feel free to respond here or on GitHub (https://github.com/tattersoftware/codeigniter4-settings). Thanks for reading!
Thanks for reading!