Child pages
  • Podstawy rozwoju szablonu

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Podstawy rozwoju templatki

Table of Contents

...

Koncepcja

PrestaShop's templating system enables web-designers and developers to easily build their own theme, provided they have a solid technical grounding.

The templating system is based on a 3-tier architecture:

  • Data tier (data objects). Database access is controlled through files in the /classes folder.
  • Application tier (data control). User-provided content is controlled by files in the root folder.
  • Presentation tier (design). All of the theme's files are in the /themes folder.

A theme belongs to the Presentation tier: your template files, located in the /themes folder, will handle the data sent by the Application tier, and return information to the Application tier.

Image Removed

See Wikipedia for more information on the 3-tier architectureSystem szablonów PrestaShop pozwala developerom i programistom łatwo zbudować swoją własną templatkę, pod warunkiem, że mają solidne podstawy techniczne.

System templatek jest zbudowany na 3 - warstwowej architekturze :

  • Poziom danych (obiekty danych). Dostęp do bazy danych jest kontrolowany poprzez pliki w folderze  /classes.
  • Warstwa aplikacji (kontrola danych). Treści dostarczane przez uzytkowników są kontrolowane przez pliki w folderze głównym.
  • Poziom prezentacji (projekt).Wszystkie pliki motywu są w folderze /themes.

Templatka należy do warstwy prezentacji: Szablon plików znajduje się w folderze /themes, będzie obsługiwać dane dostępowe wysyłane przez warstwę aplikacji i ich powrót do warstwy aplikacji.

Image Added

Zobacz w Wikipedii więcej informacji na temat architektury 3 warstwowej: http://en.wikipedia.org/wiki/Multitier_architecture#Three-tier_architecture

A Architektura 3 - tier architecture has many advantageswarstwowa ma wiele zalet:

  • It is easier to read the software's code.
  • Developers can add and edit code faster.
  • Graphic designer and HTML integrators can work with the confines of the Jest to łatwiejsze do odczytania kodu.
  • Programiści mogą dodawać i edytować kod szybciej.
  • Graficy i  integratorzy HTML mogą pracowć z zakresem powierzonych folderów /themes folder without having to understand or even read a single line of PHP code.Developers can work on additional data and modules that the HTML integrators can make use of
  • Programiści mogą pracować na dodatkowych danych i modułach, które mogą wykorzystać integratorzy HTMLDevelopers.

 

Info

This is the same principle as the Model–View–Controller Jest to ta sama zasada jak  w Model-View-Controller (MVC) architecture, only in a simpler and more accessible way.
Learn more about MVC on Wikipediaarchitektury, tylko jest to prostrzy i bardziej przystepny sposób.
Dowiedz się więcej na temat MVC w Wikipedii: http://en.wikipedia.org/wiki/Model-view-controller

Model

A model represents the application's behavior: data processing, database interaction, etc.

It describes or contains the data that have been processed by the application. It manages this data and guarantees its integrity.

View

A view is the interface with which the user interacts.

Its first role is to display the data that is been provided by the model. Its second role is to handle all the actions from the user (mouse click, element selection, buttons, etc.), and send these events to the controller.

The View does not do any processing; it only displays the result of the processing performed by the model, and interacts with the userModel pokazuje zachowanie aplikacji: przetwarzania danych, interakcji bazy danych etc.

Opisuje lub zawiera dane które zostały przetworzone przez aplikacje. Zarządza tymi danymi i zapewnia ich integralność.

Widok

Widok jest interfejsem użytkownika z którym użytkownik wchodz w interakcje.

Jego pierwszym zadaniem jest wyświetlanie danych, które są udzielane przez model. Jego druga rola służy do obsługi wszystkich działań ze strony użytkownika (kliknięcia myszą, wyboru elementów, przyciski, etc.), a także wysyłać te zdarzenia do kontrolera. 

Widok nie robi żadnego przetwarzania, tylko wyświetla widok przetwarzania wykonywanego przez model i komunikuje się z użytkownikiem.

Controller

The Controller manages synchronization events between the Model and the View, and updates both as needed. It receives all the user events and triggers the actions to perform.

...