Template Engine
Last Updated: 15.11.2024 09:45
Installation and Setup

1. Place an order to purchase the template engine.

2. Once the order is processed, update the script through the control panel.

3. Download the sample template archive and extract it into the root directory of your website on the server.

4. Select the "Template Engine" template in the "Application Settings" - "Template Settings".

Template Structure

public/template-engine

This directory contains template resources. JS scripts, style sheets, images, and other static files are accessible via URL.

template/components

This directory contains files for reusable interface elements, such as pagination or modals, to avoid code duplication. Components can also include more complex display logic.

There are no restrictions on the number and names of components.

template/layouts

This directory contains layout files that define the page structure.

Only the standard layout set is supported (error.php, main.php).

template/locales

This directory contains localization files (en.php, ru.php, uk.php) used in views. Other text data can be edited in the "Template Settings".

To add/remove localization, you need to add/remove the language in the "Template Settings", then add/remove the localization file.

template/views

This directory contains view files for pages that handle data display. File names correspond to the URLs of the pages on the site (excluding maintenance.php and not-found.php).

Unnecessary pages can be disabled in the "Template Settings" - "Pages and Sections Settings", after which the page files can be deleted.

Only the standard set of pages is supported (about.php, affiliate.php, agreement.php, aml-kyc.php, blog-show.php, blog.php, contact.php, discounts.php, exchange-confirm.php, exchange.php, faq.php, index.php, investments.php, license.php, news-show.php, news.php, order.php, privacy-policy.php, promotion.php, rates.php, reserves.php, reviews.php, user-banners.php, user-details.php, user-investments.php, user-login.php, user-orders.php, user-password-reset-confirm.php, user-password-reset.php, user-profile.php, user-referrals.php, user-register-confirm.php, user-register.php, user-verification.php).

template/helpers.php

This file may contain auxiliary global functions.

Global Functions
te_hash(string $value): string

Used for hashing a string. Data is required for working with HTML forms and variables.

te_view(): void

Used to include a view in a layout.

te_component(string $name, array $vars = []): void

Used to include a component.

te_var(string $key, array $var = []): null|string|int|float|bool|array

Used to get the value of a variable.

te_title(): string

Used to get the current page title from the "Template Settings" - "Page Titles and Keywords".

te_keywords(): string

Used to get the keywords for the current page from the "Template Settings" - "Page Titles and Keywords".

te_description(): string

Used to get the description for the current page from the "Template Settings" - "Page Titles and Keywords".

te_page(string $name): string

Used to get the content of a page from the "Template Settings" - "Page Content".

te_section(string $name): string

Used to get the content of a section from the "Template Settings" - "Section Content".

te_text(string $key, array $vars = []): string

Used to get text from the localization file in the current language.

te_csrf_token(): string

Used to get the CSRF token. Data is required for HTML form submission.

te_plugins(): void

Used to include plugins from the "Template Settings" - "Script and Style Integration".

te_captcha(string $route): void

Used to include captcha. The function’s behavior can be modified in the "Application Settings" - "Captcha Display Settings".

te_widget(string $name): null|string|int

Used to get widget configuration from the "Template Settings" - "Appearance and Widgets Settings".

te_config(string $key): null|string|int|float|bool|array

Used to get application configuration.

te_session(string $key): null|string|int|float|bool|array

Used to retrieve variables in the current session. Data is required to save filters in search forms.

te_banners(): array

Used to get banners and promotional materials for the referral program.

te_currencies(): array

Used to get the list of currencies.

te_directions(): array

Used to get the exchange direction map. Data is required for constructing the exchange direction selection block.

te_balance_directions(): array

Used to get the internal currency exchange direction map. Data is required for building the user balance deposit/withdrawal block.

te_preloaded_directions(): array

Used to preload the list of exchange directions. The function’s behavior can be modified in the "Template Settings" - "Appearance and Widgets Settings".

te_latest_orders(): array

Used to get the list of latest exchanges. The function’s behavior can be modified in the "Template Settings" - "Appearance and Widgets Settings".

te_latest_reviews(): array

Used to get the list of latest reviews. The function’s behavior can be modified in the "Template Settings" - "Appearance and Widgets Settings".

te_latest_news(): array

Used to get the list of latest news. The function’s behavior can be modified in the "Template Settings" - "Appearance and Widgets Settings".

te_user(string $key): null|string|int|float|bool|array

Used to get the authenticated user’s data.

te_user_details(): array

Used to get the list of saved payment details of the authenticated user.

te_user_inputs(): array

Used to get the list of saved field data of the authenticated user.

te_is_user_authenticated(): bool

Used to check user authentication status.

te_is_operator_online(): bool

Used to check operator status.

te_is_maintenance_mode_enabled(): bool

Used to check if maintenance mode is enabled.

te_is_not_found_page(): bool

Used to check for a non-existent page.

te_is_no_index_page(): bool

Used to check for a page excluded from indexing. Helps identify pages beyond the first, wherever pagination is used.

te_is_route_enabled(string $name): bool

Used to check for a disabled page or route.

te_order_statuses(): array

Used to get the list of available exchange order statuses.

te_order_inputs(): array

Used to get the list of available exchange order fields.

© Exchanger CMS, 2018 - 2024. E-currency exchange script. All rights reserved. Terms of Service.