The description describes the system design including the following major headings:
– Directory structure
– Data processing stream
- assets: Contains resources on JS, CSS, Images
- languages: Contains the languages file
- shinetheme: folder containing the main code
- configs: Contains the system configuration files
- controllers: Contains the event handlers of the system
- cores: Contains the core layers of the system
- helpers: set of functions separately for fast operation with the system
- libraries: Contain individual-purpose libraries, third-party libraries – libraries organized into classes.
- gateways: payment gateways
- service-types: service-types classes
- models: classes interact with the database
- views: layout files, templates for frontend and backend
- frontend: Layout for frontend
- backend: Layout inside admin
- widgets: widget classes
Data processing flow:
* Note: The following processing streams are not required, but are recommended to increase system cohesion and extend later.
- Controllers are responsible for registering Action, Filter, Post Type, Ajax Action, Shortcodes, Taxonomy, and so on to give the corresponding callback function.
- When it comes to processing data, the Controller calls an instance of the corresponding model. The model here is designed to support Active Record (Provides methods to construct the query logically). After getting the data, the controller can load that data into the view through the functions: wpbooking_load_view () – for the frontend and wpbooking_admin_load_view () – for the backend
- When you need to handle special functions, you can split them into libraries and place them in the libraries directory. The library is only allowed to provide help to the controller. No direct processing of data from the client is allowed, only if the controller provides the corresponding action or filter
- Views are responsible for displaying the corresponding data to the client
- Payment Gateways: Located in the libraries/gateways directory. When creating a new gateway, it’s required to be in this directory
- Service Types: Located in the libraries / service-types directory. This section contains administration for service types
- The system has using Omnipay library to set the payment port. You can be found in the libraries directory/vendor (Note that Omnipay is installed by Composer, click here to find more about composer).
- Setting the new file, folder name is not force but the recommended using the normal name and follow the current directory.