File structure php templates within folders -


it question how structure template files... job, templates, then, else integrates real data , in charge on putting them live.

it big project..... , have been told tidy files, have of them in same folder...

i have:

  • folder: css

    - bootstrap.min.css - featherlight.css - owl.carousel.css - font-awesome.min.css - style.css (all styles templates) 
  • folder: js

    - jquery - bootstrap.min.js - featherlight.js - owl.carousel.js - respond.min.js - modernizr.js - scripts.js (all javascript interaction on templates) 
  • folder: images

  • folder: fonts

    - folder client fonts (agenda medium , agenda light) - font awesome font files - icomooon font files 
  • and files:

    - index.php - header.php - navigation.php - navigation_home.php - footer.php - footer_myaccount.php - sidebar_products.php - sidebar.php - preferences_myaccount.php - dashboard_myaccount.php - orders_myaccount.php - filters_product.php - filters_event.php - filters_account.php - our_blog.php - single_article.php - events.php - single_event.php - producers.php - single_producer.php - countries.php - single_country.php - regions.php - single_regions.php - results.php 

and don't know how can tidy this. have been looking around , lot of people mentioned put templates in "public" folder. don't have public folder @ moment, if create it, can't put files in there, have been told tidy them....

any suggestions?

for first, sorry english.

many people use many cases structure of applications. try explain rules.

1) statis files (js, css, fonts, sprites) should separatelly application. solution can place on subdomain (e.g. st.domain.tld). , links resources must absolute. (but physically can nested directory application).

2) uploaded users media should static files -- separated domain, e.g. fs.domain.tld. full download links (or segmented data host, dir, filename, size) can store on database.

3) backend application must separate general parts: core (framework), app (modules, controllers), templates (if need). core (framework) can used many copies of application or different applications use 1 framework copy. physically, application directory can locate in path, , in public server directory can locate index.php , .htaccess (if need).

not strict example (e.g. only) structure of application directories:

~/framework/ -- can place in ~/htdocs/domain.tld/

~/htdocs/domain.tld/public_html/index.php

~/htdocs/domain.tld/static_files/*(js,css.etc) -- can bind subdomain or allowed symlink public_html

~/htdocs/domain.tld/application/

~/htdocs/domain.tld/application/modules/*(controllers/actions)

~/htdocs/domain.tld/application/views/ -- can separate same controllers (dir structure copy) , named controllers and/or actions -- allows bind same path prefixes/namespaces auto include views of controllers.

honestly, complex question , answer example explain less information structure of application.

maybe can/want edit or add more info answer -- welcome.


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -