0

I'm studying php and now I would learn codeigniter framework. I alread know how MCV pattern works. I'm building a site using codeigniter framework but a thing it isn't clear. in all folders contained in codeigniter folder where do I have to put css,imgs,script of my site?there is mabye some fixex place?

3 Answers 3

2

Have a look at this post: codeigniter separating frontend and backend

I answered a similar question yesterday on separating front-end and back-end code, but if you have a look at how I have it set up there, I've separated the CodeIgniter application code from the site assets.

This helps in general security because all of your application files are outside of your web root, which means they can't be accessed directly through a browser.


Expanding on the assets bit here:

/ application

/ - /admin
/ - - /config
/ - - /controllers
/ - - /models
/ - - /views
/ - /public
/ - - /config
/ - - /controllers
/ - - /models
/ - - /views
/ core
/ - /all the core stuff
/ public_html
/ - /admin
/ - - /assets
/ - - - /images
/ - - - /scripts
/ - - - /styles
/ - - index.php
/ - /assets
/ - - /images
/ - - /scripts
/ - - /styles
/ - index.php
Sign up to request clarification or add additional context in comments.

2 Comments

but I didn't see in your scheme where you put site asssets
Updated the post to expand on where the assets are for this structure
2

My suggestion is to make "public" folder at root. Like this:

application
system
public
- style (.css files)
- js (.js files)
- images

And then just call your style:

<style type="text/css" src="<?php echo base_url('public/style/style.css'); ?>" />

Comments

1

Make your own, simply add them to your base or to your application folder.

Example of working folder setup:

application
    cache
    config
    controllers
    core
    errors
    helpers
    hooks
    language
    libs
    logs
    mods
    texts
    third
    views
css
images
js
system
user_guide

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.