M
M
Minningt2015-10-24 12:46:00
PHP
Minningt, 2015-10-24 12:46:00

How to create the structure of the site?

Hi all. Actually the question is the following:
I develop a site in php. Created folders main folders (images / css, etc. skipped):
-- config - folder for a file with a database connection
-- includes - folder contains 2 files:

  • - head.php - it contains the meta tags themselves and the js / css connection
  • - footer.php - footer itself

-- modules - will contain connection modules (like left_menu.php, content.php, any requests to get data from the database - get_model.php, etc.)
-- there is also index.php in the root - thus it turns out that index .php will consist of almost all includes. (add nav.php, content.php etc).
It's just that I will have another View.php page where we will learn about the product in detail, and the content changes.
How it is better to implement it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
XenK, 2015-10-24
@XenK

The most convenient structure in my opinion:

www/
  app/
    controllers/
    models/
    views/
  public/
    css/
    img/
    js/

A
Alexander Wolf, 2015-10-24
@mannaro

Use some framework like Yii or Kohana and there will be no more questions like this :)

I
index0h, 2015-10-24
@index0h

app/            Система инициализации
  config/       Хост-зависимые настройки
bin/            Исполняемые файлы
src/            Исходный код проекта
  command/      Контроллеры консольных команд
  component/    Разнообразные хэлперы
  controller/   Web-ориентированные контроллеры
  entity/       Сущности данных
  repository/   Репозитории БД
  migration/    Миграции БД
  service/      Вспомогательные сервисы, например сервис отправки почты
  test/         Тесты системы
    fixture/    Фикстуры БД
    functional/ Функциональные тесты
    unit/       Unit тесты
vendor/         Внешние зависимости проекта
web/            Публичный каталог для web сервера
  assets/       Статические файлы
    css/
    font/
    img/
    js/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question