You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extensions.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -352,7 +352,7 @@ This design ensures that your Go code has complete control over how the object's
352
352
353
353
### Declaring Constants
354
354
355
-
The generator supports exporting Go constants to PHP using two directives: `//export_php:const` for global constants and `//export_php:classconstant` for class constants. This allows you to share configuration values, status codes, and other constants between Go and PHP code.
355
+
The generator supports exporting Go constants to PHP using two directives: `//export_php:const` for global constants and `//export_php:classconst` for class constants. This allows you to share configuration values, status codes, and other constants between Go and PHP code.
356
356
357
357
#### Global Constants
358
358
@@ -376,27 +376,27 @@ const STATUS_ERROR = iota
376
376
377
377
#### Class Constants
378
378
379
-
Use the `//export_php:classconstant ClassName` directive to create constants that belong to a specific PHP class:
379
+
Use the `//export_php:classconst ClassName` directive to create constants that belong to a specific PHP class:
380
380
381
381
```go
382
382
package example
383
383
384
-
//export_php:classconstant User
384
+
//export_php:classconst User
385
385
constSTATUS_ACTIVE = 1
386
386
387
-
//export_php:classconstant User
387
+
//export_php:classconst User
388
388
constSTATUS_INACTIVE = 0
389
389
390
-
//export_php:classconstant User
390
+
//export_php:classconst User
391
391
constROLE_ADMIN = "admin"
392
392
393
-
//export_php:classconstant Order
393
+
//export_php:classconst Order
394
394
constSTATE_PENDING = iota
395
395
396
-
//export_php:classconstant Order
396
+
//export_php:classconst Order
397
397
constSTATE_PROCESSING = iota
398
398
399
-
//export_php:classconstant Order
399
+
//export_php:classconst Order
400
400
constSTATE_COMPLETED = iota
401
401
```
402
402
@@ -437,10 +437,10 @@ const STR_REVERSE = iota
437
437
//export_php:const
438
438
constSTR_NORMAL = iota
439
439
440
-
//export_php:classconstant StringProcessor
440
+
//export_php:classconst StringProcessor
441
441
constMODE_LOWERCASE = 1
442
442
443
-
//export_php:classconstant StringProcessor
443
+
//export_php:classconst StringProcessor
444
444
constMODE_UPPERCASE = 2
445
445
446
446
//export_php:function repeat_this(string $str, int $count, int $mode): string
Copy file name to clipboardExpand all lines: docs/fr/extensions.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -349,7 +349,7 @@ Cette conception garantit que votre code Go a un contrôle complet sur la façon
349
349
350
350
### Déclarer des Constantes
351
351
352
-
Le générateur prend en charge l'exportation de constantes Go vers PHP en utilisant deux directives : `//export_php:const` pour les constantes globales et `//export_php:classconstant` pour les constantes de classe. Cela vous permet de partager des valeurs de configuration, des codes de statut et d'autres constantes entre le code Go et PHP.
352
+
Le générateur prend en charge l'exportation de constantes Go vers PHP en utilisant deux directives : `//export_php:const` pour les constantes globales et `//export_php:classconst` pour les constantes de classe. Cela vous permet de partager des valeurs de configuration, des codes de statut et d'autres constantes entre le code Go et PHP.
353
353
354
354
#### Constantes Globales
355
355
@@ -373,27 +373,27 @@ const STATUS_ERROR = iota
373
373
374
374
#### Constantes de Classe
375
375
376
-
Utilisez la directive `//export_php:classconstant ClassName` pour créer des constantes qui appartiennent à une classe PHP spécifique :
376
+
Utilisez la directive `//export_php:classconst ClassName` pour créer des constantes qui appartiennent à une classe PHP spécifique :
377
377
378
378
```go
379
379
package example
380
380
381
-
//export_php:classconstant User
381
+
//export_php:classconst User
382
382
constSTATUS_ACTIVE = 1
383
383
384
-
//export_php:classconstant User
384
+
//export_php:classconst User
385
385
constSTATUS_INACTIVE = 0
386
386
387
-
//export_php:classconstant User
387
+
//export_php:classconst User
388
388
constROLE_ADMIN = "admin"
389
389
390
-
//export_php:classconstant Order
390
+
//export_php:classconst Order
391
391
constSTATE_PENDING = iota
392
392
393
-
//export_php:classconstant Order
393
+
//export_php:classconst Order
394
394
constSTATE_PROCESSING = iota
395
395
396
-
//export_php:classconstant Order
396
+
//export_php:classconst Order
397
397
constSTATE_COMPLETED = iota
398
398
```
399
399
@@ -434,10 +434,10 @@ const STR_REVERSE = iota
434
434
//export_php:const
435
435
constSTR_NORMAL = iota
436
436
437
-
//export_php:classconstant StringProcessor
437
+
//export_php:classconst StringProcessor
438
438
constMODE_LOWERCASE = 1
439
439
440
-
//export_php:classconstant StringProcessor
440
+
//export_php:classconst StringProcessor
441
441
constMODE_UPPERCASE = 2
442
442
443
443
//export_php:function repeat_this(string $str, int $count, int $mode): string
0 commit comments