Using \Config::set vs \Config::save

Permalink
I can override the system login page using:
\Config::save('app.theme_paths./login', ['theme_name']);


The docs athttps://documentation.concrete5.org/developers/packages/storing-conf... say I should be able to use \Config::set to override at runtime but this does not work. It's a pain because \Config::clear doesn't erase the save'd value when run in a package uninstall because that uses 'set' - you have to manually delete the app.php file that was created.

Anyone know why, is this a bug? It would be much better to use \Config::set in the controller's on_start and never muck about with the filesystem.

surefyre
 
jakobfuchs replied on at Permalink Best Answer Reply
jakobfuchs
Use
\Route::setThemeByRoute('/login', 'theme_handle');
in your package's on_start() method to dynamically overwrite the theme used for single pages (or any other page).
surefyre replied on at Permalink Reply
surefyre
Thanks for that... and for e.g. /dash/board/welcome I need the filepath /dashboard/welcome under my theme dir?
jakobfuchs replied on at Permalink Reply
jakobfuchs
I think that should work. But that just changes the theme, overwriting the actual template would require a different approach.

If you go to /concrete/src/Page/Single.php and look at the getThemeableCorePages() method you'll see which page templates you can override by providing templates in your theme folder.