Download the PHP package arian-taylor/pw-components-php without Composer
On this page you can find all versions of the php package arian-taylor/pw-components-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pw-components-php
pw-components-php-dev
Requirements
- PHP version 8.0 ou supérieure
Installation
-
Avec composer:
- Avec composer.phar:
Utilisation
Recaptcha
Importation de la classe
Instanciation
Exemple d’utilisation
On peut utiliser partout la méthode isValidReCaptcha
avec recaptcha_token
en paramètre.
Si on veut récupérer le data
retourné par reCAPTCHA
en cas d’erreur ou du succès, on peut l’avoir avec recaptchaData
RateLimiter
Importation de la classe
Instanciation
Exemple d’utilisation
DataTable
Importation de la classe
Configuration
Modification du fichier services.yaml pour autoriser le autowire de l’apiDataTable autowire: true
Modification du fichier bundle.php
Exemple d’utilisation
Params
Importation de la classe
Instanciation
Exemple d’utilisation
Export Excel
Importation de la classe
Configuration
Modification du fichier services.yaml pour autoriser le autowire de l’apiDataTable autowire: true
Exemple d’utilisation (simple onglet)
1- Création d’un service d’export exemple : UserExportExcelService.php
2- Création du contrôleur exemple : ExportController.php
Exemple d’utilisation (multiple onglet)
1- Création d’un service d’export exemple : UserExportExcelService.php
Export Pdf
Importation de la classe
Configuration
Modification du fichier services.yaml pour autoriser le autowire de l’apiDataTable autowire: true
Exemple d’utilisation
1- Création d’un service d’export exemple : UserExportPdfService.php
2- Création du template exemple : template\pdf\template.html.twig
3- Création de la fonction Twig renderPdfContent Dans le fichier src\Twig\AppExtension.php
4- Création du contenu html exemple : templates\pdf\content.html.twig
5- Création du contrôleur exemple : ExportController.php
Generator
Configuration
Modification du fichier services.yaml pour autoriser le autowire de Pw\Command\GeneratorCommand autowire: true
Exemple d'utilisation
Pour créer une page front
Pour créer un API front
Pour créer un service front
Syntaxe
Autres utilisations avec les options
Pour créer une page front avec une méthode index
Pour créer un API front avec une méthode index
Pour créer un service front avec les méthodes save, load, list
Pour avoir de l'aide
Utilisation de la commande en mode interactif (type ='page ou service ou api')
FileValidator
Importation de la classe
Instanciation
Exemple d’utilisation
Utilisation avec les définitions des extensions, des types et de la taille des fichiers autorisés
Utilisation de verifier le type de fichier comme image
en appelant juste la méthode isImage
.
Quelques méthodes sur la validation de fichier.
All versions of pw-components-php with dependencies
dompdf/dompdf Version ^2.0
phpoffice/phpspreadsheet Version ^1.28
ext-ctype Version *
ext-iconv Version *
symfony/console Version 6.1.*
symfony/dotenv Version 6.1.*
symfony/flex Version ^2
symfony/framework-bundle Version 6.1.*
symfony/runtime Version 6.1.*
symfony/yaml Version 6.1.*