tigress / core
Tigress core library
Installs: 494
Dependents: 10
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tigress/core
Requires
- php: >=8.5
- ext-dom: *
- ext-exif: *
- ext-libxml: *
- dompdf/dompdf: >=v3
- ezyang/htmlpurifier: ^4.18
- monolog/monolog: ^3.9
- tigress/controller: >=2025
- tigress/data-converter: >=2025
- tigress/data-files: >=2025
- tigress/database: >=2025
- tigress/encryption: >=2024
- tigress/menu: >=2025
- tigress/model: >=2025
- tigress/repository: >=2026
- tigress/rights: >=2025
- tigress/router: >=2025
- tigress/security: >=2026
- twig/intl-extra: ^v3
- twig/twig: ^v3
Requires (Dev)
- dev-main
- 2026.01.15.0
- 2026.01.09.2
- 2026.01.09.1
- 2026.01.09.0
- 2026.01.08.2
- 2026.01.08.1
- 2026.01.08.0
- 2026.01.07.0
- 2025.12.19.1
- 2025.12.19.0
- 2025.12.12.1
- 2025.12.12.0
- 2025.12.09.0
- 2025.10.16.2
- 2025.10.16.1
- 2025.10.16.0
- 2025.09.30.3
- 2025.09.30.2
- 2025.09.30.1
- 2025.09.30.0
- 2025.09.26.0
- 2025.09.25.2
- 2025.09.25.1
- 2025.09.22.6
- 2025.09.22.5
- 2025.09.22.4
- 2025.09.22.3
- 2025.09.22.2
- 2025.09.22.1
- 2025.09.22.0
- 2025.09.19.0
- 2025.09.17.0
- 2025.08.27.2
- 2025.08.27.1
- 2025.08.27.0
- 2025.07.02.1
- 2025.07.02.0
- 2025.06.30.2
- 2025.06.30.1
- 2025.06.30.0
- 2025.06.27.3
- 2025.06.27.2
- 2025.06.27.1
- 2025.06.27.0
- 2025.05.22.18
- 2025.05.22.17
- 2025.05.22.16
- 2025.05.22.15
- 2025.05.22.14
- 2025.05.22.13
- 2025.05.22.12
- 2025.05.22.11
- 2025.05.22.10
- 2025.05.22.9
- 2025.05.22.8
- 2025.05.22.7
- 2025.05.22.6
- 2025.05.22.5
- 2025.05.22.4
- 2025.05.22.3
- 2025.05.22.2
- 2025.05.22.1
- 2025.05.22.0
- 2025.05.19.7
- 2025.05.19.6
- 2025.05.19.5
- 2025.05.19.4
- 2025.05.19.3
- 2025.05.19.2
- 2025.05.19.1
- 2025.05.19.0
- 2025.05.08.3
- 2025.05.08.2
- 2025.05.08.1
- 2025.05.08.0
- 2025.03.14.18
- 2025.03.14.17
- 2025.03.14.16
- 2025.03.14.15
- 2025.03.14.14
- 2025.03.14.13
- 2025.03.14.12
- 2025.03.14.11
- 2025.03.14.10
- 2025.03.14.9
- 2025.03.14.8
- 2025.03.14.7
- 2025.03.14.6
- 2025.03.14.5
- 2025.03.14.4
- 2025.03.14.3
- 2025.03.14.2
- 2025.03.14.1
- 2025.03.14.0
- 2025.03.03.3
- 2025.03.03.2
- 2025.03.03.1
- 2025.03.03.0
- 2025.02.20.9
- 2025.02.20.8
- 2025.02.20.7
- 2025.02.20.6
- 2025.02.20.5
- 2025.02.20.4
- 2025.02.20.3
- 2025.02.20.2
- 2025.02.20.1
- 2025.02.20.0
- 2025.02.10.0
- 2025.01.24.14
- 2025.01.24.13
- 2025.01.24.12
- 2025.01.24.11
- 2025.01.24.10
- 2025.01.24.9
- 2025.01.24.8
- 2025.01.24.7
- 2025.01.24.6
- 2025.01.24.5
- 2025.01.24.3
- 2025.01.24.2
- 2025.01.24.1
- 2025.01.24.0
- 2025.01.17.6
- 2025.01.17.5
- 2025.01.17.4
- 2025.01.17.3
- 2025.01.17.2
- 2025.01.17.1
- 2025.01.17.0
- 2025.01.14.1
- 2025.01.14.0
- 2025.01.10.1
- 2025.01.10.0
- 2025.01.08.0
- 2025.01.07.1
- 2025.01.07.0
- 2025.01.03.0
- 2024.12.20.0
- 2024.12.18.0
- 2024.12.17.0
- 2024.11.28.0
- dev-develop
This package is auto-updated.
Last update: 2026-01-15 10:41:36 UTC
README
The Core module of the Tigress Framework
Installation
You can create a new Tigress project by using composer.
composer create-project tigress/tigress <project_name>
Documentation
Core Module (Class: Tigress\Core)
The Core module provides the essential functionalities required for building applications using the Tigress Framework. It includes components for routing, request handling, response generation, and middleware support.
Configuration files
- config/config.php: This file contains the main configuration settings for the application, including database connections, caching options, and other global settings.
- config/routes.php: This file defines the routing rules for the application, mapping URLs to specific controllers and actions.
- system/config.php: This file contains system-level configuration settings that are essential for the framework's operation.
More information about these files can be found in the README.md file located in the tigress/tigress package.
Constants used containing configurations
- CONFIG: Contains the configuration settings for the application. File located at
config/config.php. - SYSTEM: Contains the system configuration settings for the Tigress Framework. File located at
system/config.php. - BASE_URL: The base URL of the application → used for generating absolute URLs.
- SYSTEM_ROOT: The root directory of the Tigress Framework installation.
- WEBSITE: The website name as defined in the configuration file.
- SERVER_TYPE: The type of server the application is running on (e.g., development, production or test).
Constants used containing Classes
- TRANSLATIONS: The helper class for configuring and managing translations in the application.
- TWIG: The Twig templating engine instance used for rendering views.
- MENUS: The menu manager instance used for handling navigation menus in the application.
- SECURITY: The security manager instance used for handling authentication and authorization.
- RIGHTS: The rights manager instance used for managing user permissions.
- ROUTER: The router instance used for handling HTTP requests and routing them to the appropriate controllers.
- DATABASE: The database connection instance used for interacting with the database.
Functions that can be used
- debug(mixed $data, bool $stop = true): void
Outputs debug information about the provided data. If $stop is true, it stops the execution of the script after displaying the debug information.
DisplayHelper Module (Class: Tigress\DisplayHelper)
The DisplayHelper module provides utility functions for rendering views and managing templates in the Tigress Framework. If running on a development server, it puts the Twig environment in debug mode.
Functions that can be used
-
addGlobal(string $name, mixed $value): void
Adds a global variable to the Twig environment. -
addPath(string $path): void
Adds a new path to the Twig loader to look for templates. -
render(?string $template, array $data = [], string $type = 'TWIG', int $httpResponseCode = 200, array $config = []): string
Renders a template with the provided data and returns the rendered content as a string based on the specified type ( TWIG, PHP, or JSON).- $template: The name of the template to render.
- $data: An associative array of data to pass to the template.
- $type: The type of template to render (HTML, JSON, DT, PDF, PHP, TWIG, STWIG or XML).
- $httpResponseCode: The HTTP response code to set for the response.
- $config: Additional configuration options for rendering.
-
redirect(string $url): void
Redirects the user to the specified URL. This can be an internal or external URL.
Data available in all Twig templates
- _COOKIE: The current COOKIE request data.
- _GET: The current GET request data.
- _POST: The current POST request data.
- _SESSION: The current session data.
- BASE_URL: The base URL of the application.
- SERVER_TYPE: The type of server the application is running on (e.g., development, production or test).
- SYSTEM_ROOT: The root directory of the Tigress Framework installation.
- WEBSITE: The website information as defined in the configuration file.
- menu: The menu manager instance used for handling navigation menus in the application.
- rights: Array of the rights of the user. (access, read, write and delete).
Extra added Twig filters
- base64_encode: Encodes a string using Base64 encoding.
- bitwise_and: Performs a bitwise AND operation between two integers.
- bitwise_or: Performs a bitwise OR operation between two integers.
- bitwise_xor: Performs a bitwise XOR operation between two integers.
- bitwise_not: Performs a bitwise NOT operation on an integer.
Extra added Twig functions
- __: Returns the translated string for the given key using the TRANSLATIONS class.
- add_slider: Renders a slider component with the specified parameters.
- file_exists: Checks if a file exists at the given path.
- get_all_attrs: Returns a string of all attributes for an HTML element.
- get_attr: Returns the value of a specific attribute for an HTML element.
- in_keys: Checks if a value exists in the keys of an array.
- in_values: Checks if a value exists in the values of an array.
- match: Performs a regular expression match on a string.
- strip_dangerous_tags: Strips dangerous HTML tags from a string to prevent XSS attacks.
- week_range: Returns the start and end dates of the week for a given date.
LoggerHelper Module (Class: Tigress\LoggerHelper)
The LoggerHelper module provides logging functionalities for the Tigress Framework. It allows you to log messages at different levels (info, warning, error) and manage log files.
Functions that can be used
-
create(string $channelName, Level $level = Level::Error, int $retentionDays = 30, ?string $dateFormat = 'Y-m-d', ?string $logDirectory = null): LoggerInterface
Creates and returns a logger instance with the specified channel name, log level, retention days, date format, and log directory.- $channelName: The name of the logging channel.
- $level: The minimum log level to record (default is Error).
- $retentionDays: The number of days to retain log files (default is 30).
- $dateFormat: The date format for log file names (default is 'Y-m-d').
- $logDirectory: The directory where log files will be stored (default is 'SYSTEM_ROOTS/logs').
-
getDefault(): LoggerInterface
Returns the default logger instance with the channel name 'tigress'.
PdfCreatorHelper Module (Class: Tigress\PdfCreatorHelper)
The PdfCreatorHelper module provides functionalities for generating PDF documents using the Dompdf library in the Tigress Framework. It allows you to create PDF files from HTML content with various configuration options.
It can also be used as a standalone library.
Functions that can be used
-
createPdf(string $html, string $format = 'A4', string $orientation = 'portrait', string $filename = ' document.pdf', string $filepath = '/public/tmp/', bool $pagination = false, int $attachment = 1): void
Creates a PDF document from the provided HTML content and creates a stream of file depending.- $html: The HTML content to be converted into a PDF.
- $format: The page format for the PDF (default is 'A4').
- $orientation: The page orientation for the PDF (default is 'portrait').
- $filename: The name of the generated PDF file (default is 'document.pdf').
- $filepath: The directory where the PDF file will be saved (default is '/public/tmp/').
- $pagination: Whether to include pagination in the PDF (default is false).
- $attachment: The attachment disposition for the PDF (2 for saving the file on the server, 1 for download, 0 for inline display; default is 1).
-
getImage(string $image, string $alt = 'Logo', ?array $options = null): string
Returns img-tag with the base64 encoded string of an image to be used in the PDF.- $image: The path to the image file.
- $alt: The alt text for the image (default is 'Logo').
- $options: An associative array of options for the image (e.g., width and/or height).
-
setLanguage(string $language): void
Sets the language for the PDF document.- $language: The language code (e.g., 'en', 'fr', 'de').
TranslationHelper Module (Class: Tigress\TranslationHelper)
The TranslationHelper module provides functionalities for managing translations and localization in the Tigress Framework. It allows you to load translation files, retrieve translated strings, and handle multiple languages.
Functions that can be used
- load(string $filePath): void
Loads a translation file from the specified file path and adds its translations to the system.- $filePath: The path to the translation file.
No other functionality is needed because the Tigress Core provides the __('...') function for translations in Twig templates, PHP files and JavaScript files.
Build in Routes
The Tigress Core module comes with several built-in routes.
- /phpinfo: Displays the PHP info page. (Only available for superadmins).
- /version: Displays the current version of the Tigress Framework and the loaded modules.
- /help: Displays the Tigress Framework Documentation page. (Not yet available).