• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Theme Manager Library

#1
Hi all- I found myself trying to force a few tools to do what they weren't made to do in order to get user-selectable themes working. I cobbled together a new solution that I thought I would share in case anyone else was interested:

Tatter/Themes - Lightweight user themes for CodeIgniter 4

Basic usage:

1. Install with Composer: `> composer require tatter/themes`
2. Update the database: `> php spark migrate:latest -all`
3. Seed the database: `> php spark db:seed \\Tatter\\Themes\\Database\\Seeds\\ThemeSeeder`
4. Place theme files in public/themes/default
5. Add theme files to your page, e.g.: `echo view('\Tatter\Themes\Views\css)`

There are CLI commands to list and add new themes (`> spark themes:add`), and some helper functions and routes to make it easy for users to select a new theme (`theme_form()`). I'm using this library already to add a dark theme option to an existing CodeIgniter 4 site.

The Themes library uses Tatter/Settings so user theme choices will persist across sessions and are fast to configure and load.



Thanks for reading! I'm always glad for feedback and suggestions, feel free to leave a comment here or check out the repo at https://github.com/tattersoftware/codeigniter4-themes.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.