I am starting out with CodeIgniter 4 and am using https://github.com/noraziz/ci4-twiggy as my template engine.
The documentation is pretty sparce, but so far it is working, with the exception that I am unable to load a custom CSS file when it is not in the public folder.
So - setting my CSS file to
<link rel="stylesheet" href="main.css" />
loads the file, as it then default looks in the public folder. Setting it thus to:
<link rel="stylesheet" href="../app/Themes/mytheme/assets/css/main.css" />
I was expecting that I would be able to load it, but I am not. It keeps giving me a 404 error. This user had a similar issue, How can I load css or js file in codeigniter 4?, however, his files were located in the public folder, and was not using Twig, so the solution did not work for me either.
I had several other attempts (including removing the app/.htaccess file temporarily):
{{ base_url() }}app/Themes/mytheme/assets/css/main.css
app/Themes/mytheme/assets/css/main.css
Themes/mytheme/assets/css/main.css
mytheme/assets/css/main.css
assets/css/main.css
css/main.css
main.css (after removing the file from **public** folder, of course)
Since the template engine is not in the public folder, I do not want to move my CSS to the public folder, unless there is no other way without compromising security. Is there?