How do you organize your template structure in CodeIgniter?

后端 未结 3 1425
野趣味
野趣味 2021-02-06 04:44

I will be building a CMS for my final Web Development course project, and i\'ve been challenged by my teacher creating it in an MVC system, and for now, I\'ll be using CodeIgnit

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-06 05:18

    A good file/folder structure would be the below:

    website_folder/
    –––– application/
    –––––––– config/
    –––––––––––– autoload.php
    –––––––––––– config.php
    –––––––––––– ...
    –––––––– controllers/
    –––––––––––– examples.php
    –––––––––––– index.html
    –––––––––––– welcome.php
    –––––––– ...
    –––––––– views/
    ––––––––---- templates/
    ––––––––-------- backend.php
    ––––––––-------- frontend.php
    –––––––––––– ....
    –––––––––––– example.php
    –––––––––––– index.html
    –––––––––––– welcome_message.php    
    –––– assets/
    –––––––– css/
    –––––––– js/
    –––––––– images/
    –––––––– templates/
    ––––––––---- frontend/
    ––––––––-------- css/
    ––––––––-------- js/
    ––––––––-------- images/
    ––––––––---- backend/   
    ––––––––-------- css/
    ––––––––-------- js/
    ––––––––-------- images/
    –––––––– uploads/
    –––––––– index.html
    –––– system/
    –––– user_guide/
    –––– index.php
    –––– license.txt 
    

    This is just a suggestion. So you will have your template views at views/templates and your css/js files at assets/templates/

提交回复
热议问题