Where is it a good practise to put CSS files in this framework? Maybe in/application/layouts/
folder?
How can I add CSS file to header section? Maybe there is a native function for it?
CSS files need to live in the public
folder so a browser can view them. Typically you'd put them somewhere like public/css
, but you can organise them however you wish.
As for adding them to the header section, just add the relevant HTML to the layout like you would any normal HTML page. If you need to do this programmatically (e.g. to add a CSS just for one particular controller action), you can use the headStyle() helper.
You should include css files in application/views/layouts/*
files
css files should be stored in public/
mostly it is public/css/
What I do is to generate from every css file just one file and remove all white characters. There are many css compression classes for example this
If you include only 1 file loading page speed will increase.