-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_access.php
More file actions
101 lines (78 loc) · 2.43 KB
/
_access.php
File metadata and controls
101 lines (78 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
declare(strict_types=1);
/*
* This file is part of the QuidPHP package <https://quidphp.com>
* Author: Pierre-Philippe Emond <emondpph@gmail.com>
* License: https://github.com/quidphp/core/blob/master/LICENSE
*/
namespace Quid\Core;
use Quid\Main;
use Quid\Routing;
// _access
// trait that provides methods to useful objects related to the Boot
trait _access
{
// trait
use _bootAccess;
// session
// retourne l'objet session
final public static function session():Routing\Session
{
return static::boot()->session();
}
// sessionCom
// retourne l'objet com de session
final public static function sessionCom():Com
{
return static::session()->com();
}
// sessionUser
// retourne l'objet user de session
final public static function sessionUser():Row
{
return static::session()->user();
}
// lang
// retourne l'objet lang
final public static function lang():Main\Lang
{
return static::boot()->lang();
}
// langText
// retourne un élément de texte à partir de l'objet lang
final public static function langText($key,?array $replace=null,?string $lang=null,?array $option=null):?string
{
return static::lang()->text($key,$replace,$lang,$option);
}
// langPlural
// retourne un élément de texte plural à partir de l'objet lang
final public static function langPlural($value,$key,?array $replace=null,?array $plural=null,?string $lang=null,?array $option=null):?string
{
return static::lang()->plural($value,$key,$replace,$plural,$lang,$option);
}
// services
// retourne l'objet services
final public static function services():Main\Services
{
return static::boot()->services();
}
// service
// retourne un objet service, envoie une exception si n'existe pas
final public static function service(string $key):Main\Service
{
return static::boot()->checkService($key);
}
// serviceMailer
// retourne l'objet mailer à utiliser pour envoyer un courriel, ne peut pas retourner null
final public static function serviceMailer($key=null):Main\ServiceMailer
{
return static::boot()->checkServiceMailer($key);
}
// response
// retourne l'objet de la reponse courante
final public static function response():Main\ResponseCurrent
{
return static::boot()->response();
}
}
?>