Skip to content

Commit 6a2ea54

Browse files
committed
update
1 parent 155587c commit 6a2ea54

File tree

1 file changed

+90
-90
lines changed

1 file changed

+90
-90
lines changed

04-api.md

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -9,120 +9,120 @@ This is a reference of all global variables and functions.
99

1010
## Functions
1111

12-
| Function | Location | Purpose |
13-
| ------------------------------------------- | ------------- | --------------- |
14-
| `e($variable) ` | *.phtml | Output string (escaped) |
15-
| `d($variable) ` | * | Debugging |
16-
| `t($id,...) ` | * | Translation |
12+
| Function | Location | Purpose |
13+
| ------------------------------------------- | ------------- | ----------------------- |
14+
| `e($variable) ` | *.phtml | Output string (escaped) |
15+
| `d($variable) ` | * | Debugging |
16+
| `t($id,...) ` | * | Translation |
1717

1818
## Database
1919

20-
| Function | Location | Purpose |
21-
| ------------------------------------------- | ------------- | --------------- |
22-
| `DB::select($sql,...):array ` | *.php | Select all rows |
23-
| `DB::selectOne($sql,...):array\|false ` | *.php | Select first row |
24-
| `DB::selectValue($sql,...):mixed ` | *.php | Select single value |
25-
| `DB::selectValues($sql,...):array ` | *.php | Select column values |
26-
| `DB::selectPairs($sql,...):array ` | *.php | Select key-value pairs |
27-
| `DB::insert($sql,...):int ` | *.php | Insert record |
28-
| `DB::update($sql,...):int ` | *.php | Update records |
29-
| `DB::delete($sql,...):int ` | *.php | Delete records |
30-
| `DB::query($sql,...):mixed ` | *.php | Execute query |
31-
| `DB::close():void ` | *.php | Close connection |
20+
| Function | Location | Purpose |
21+
| ------------------------------------------- | ------------- | ---------------------- |
22+
| `DB::select($sql,...):array ` | *.php | Select all rows |
23+
| `DB::selectOne($sql,...):array\|false ` | *.php | Select first row |
24+
| `DB::selectValue($sql,...):mixed ` | *.php | Select single value |
25+
| `DB::selectValues($sql,...):array ` | *.php | Select column values |
26+
| `DB::selectPairs($sql,...):array ` | *.php | Select key-value pairs |
27+
| `DB::insert($sql,...):int ` | *.php | Insert record |
28+
| `DB::update($sql,...):int ` | *.php | Update records |
29+
| `DB::delete($sql,...):int ` | *.php | Delete records |
30+
| `DB::query($sql,...):mixed ` | *.php | Execute query |
31+
| `DB::close():void ` | *.php | Close connection |
3232

3333
## HTTP Client
3434

35-
| Function | Location | Purpose |
36-
| ------------------------------------------- | ------------- | --------------- |
37-
| `Curl::call($method,$url,$data,...):array ` | *.php | HTTP request |
38-
| `Curl::navigate($method,$url,$data,...):array` | *.php | HTTP with redirects |
39-
| `Curl::callCached($exp,$method,$url,...):array` | *.php | Cached HTTP request |
40-
| `Curl::navigateCached($exp,$method,...):array` | *.php | Cached with redirects |
35+
| Function | Location | Purpose |
36+
| ----------------------------------------------- | ------------- | --------------------- |
37+
| `Curl::call($method,$url,$data,...):array ` | *.php | HTTP request |
38+
| `Curl::navigate($method,$url,$data,...):array ` | *.php | HTTP with redirects |
39+
| `Curl::callCached($exp,$method,$url,...):array` | *.php | Cached HTTP request |
40+
| `Curl::navigateCached($exp,$method,...):array ` | *.php | Cached with redirects |
4141

4242
## Authentication
4343

44-
| Function | Location | Purpose |
45-
| ------------------------------------------- | ------------- | --------------- |
46-
| `Auth::login($user,$pass,$totp=''):array ` | *.php | Login user |
47-
| `Auth::logout():bool ` | *.php | Logout user |
48-
| `Auth::register($user,$pass):int ` | *.php | Register user |
49-
| `Auth::update($user,$pass):int ` | *.php | Update password |
50-
| `Auth::updateTotpSecret($user,$secret):int ` | *.php | Enable 2FA |
51-
| `Auth::exists($user):bool ` | *.php | Check user exists |
44+
| Function | Location | Purpose |
45+
| -------------------------------------------- | ------------- | ----------------- |
46+
| `Auth::login($user,$pass,$totp=''):array ` | *.php | Login user |
47+
| `Auth::logout():bool ` | *.php | Logout user |
48+
| `Auth::register($user,$pass):int ` | *.php | Register user |
49+
| `Auth::update($user,$pass):int ` | *.php | Update password |
50+
| `Auth::updateTotpSecret($user,$secret):int ` | *.php | Enable 2FA |
51+
| `Auth::exists($user):bool ` | *.php | Check user exists |
5252

5353
## Passwordless Auth
5454

55-
| Function | Location | Purpose |
56-
| ------------------------------------------- | ------------- | --------------- |
57-
| `NoPassAuth::token($user):string ` | *.php | Generate login token |
58-
| `NoPassAuth::login($token,$rem=false,...):array` | *.php | Login with token |
59-
| `NoPassAuth::logout():bool ` | *.php | Logout user |
60-
| `NoPassAuth::register($user):int ` | *.php | Register user |
61-
| `NoPassAuth::remember():bool ` | *.php | Restore session |
62-
| `NoPassAuth::update($user):int ` | *.php | Reset password |
63-
| `NoPassAuth::updateTotpSecret($user,$sec):int` | *.php | Enable 2FA |
55+
| Function | Location | Purpose |
56+
| ------------------------------------------------ | ------------- | -------------------- |
57+
| `NoPassAuth::token($user):string ` | *.php | Generate login token |
58+
| `NoPassAuth::login($token,$rem=false,...):array` | *.php | Login with token |
59+
| `NoPassAuth::logout():bool ` | *.php | Logout user |
60+
| `NoPassAuth::register($user):int ` | *.php | Register user |
61+
| `NoPassAuth::remember():bool ` | *.php | Restore session |
62+
| `NoPassAuth::update($user):int ` | *.php | Reset password |
63+
| `NoPassAuth::updateTotpSecret($user,$sec):int ` | *.php | Enable 2FA |
6464

6565
## Router
6666

67-
| Function | Location | Purpose |
68-
| ------------------------------------------- | ------------- | --------------- |
69-
| `Router::redirect($url,$perm=false):void ` | *.php | Redirect to URL |
70-
| `Router::json($object):void ` | *.php | Output JSON |
71-
| `Router::download($name,$data):void ` | *.php | Download data |
72-
| `Router::file($name,$path):void ` | *.php | Download file |
73-
| `Router::getUrl():string ` | *.php | Get current URL |
74-
| `Router::getBaseUrl():string ` | *.php | Get base URL |
75-
| `Router::getRequest():string ` | *.php | Get request URI |
76-
| `Router::getView():string ` | *.php | Get view path |
77-
| `Router::getAction():string ` | *.php | Get action path |
78-
| `Router::getTemplateView():string ` | *.php | Get template view |
79-
| `Router::getTemplateAction():string ` | *.php | Get template action |
80-
| `Router::getParameters():array ` | *.php | Get URL parameters |
81-
| `Router::getCanonical():string ` | *.php | Get canonical URL |
82-
| `Router::getRedirect():?string ` | *.php | Get redirect URL |
67+
| Function | Location | Purpose |
68+
| ------------------------------------------- | ------------- | ------------------- |
69+
| `Router::redirect($url,$perm=false):void ` | *.php | Redirect to URL |
70+
| `Router::json($object):void ` | *.php | Output JSON |
71+
| `Router::download($name,$data):void ` | *.php | Download data |
72+
| `Router::file($name,$path):void ` | *.php | Download file |
73+
| `Router::getUrl():string ` | *.php | Get current URL |
74+
| `Router::getBaseUrl():string ` | *.php | Get base URL |
75+
| `Router::getRequest():string ` | *.php | Get request URI |
76+
| `Router::getView():string ` | *.php | Get view path |
77+
| `Router::getAction():string ` | *.php | Get action path |
78+
| `Router::getTemplateView():string ` | *.php | Get template view |
79+
| `Router::getTemplateAction():string ` | *.php | Get template action |
80+
| `Router::getParameters():array ` | *.php | Get URL parameters |
81+
| `Router::getCanonical():string ` | *.php | Get canonical URL |
82+
| `Router::getRedirect():?string ` | *.php | Get redirect URL |
8383

8484
## Session
8585

86-
| Function | Location | Purpose |
87-
| ------------------------------------------- | ------------- | --------------- |
88-
| `Session::getCsrfInput():void ` | *.phtml | Output CSRF field |
89-
| `Session::checkCsrfToken():bool ` | *.php | Verify CSRF token |
90-
| `Session::start():void ` | *.php | Start session |
91-
| `Session::end():void ` | *.php | End session |
92-
| `Session::regenerate():void ` | *.php | Regenerate session |
86+
| Function | Location | Purpose |
87+
| ------------------------------------------- | ------------- | ------------------ |
88+
| `Session::getCsrfInput():void ` | *.phtml | Output CSRF field |
89+
| `Session::checkCsrfToken():bool ` | *.php | Verify CSRF token |
90+
| `Session::start():void ` | *.php | Start session |
91+
| `Session::end():void ` | *.php | End session |
92+
| `Session::regenerate():void ` | *.php | Regenerate session |
9393

9494
## Buffer
9595

96-
| Function | Location | Purpose |
97-
| ------------------------------------------- | ------------- | --------------- |
98-
| `Buffer::start($name):void ` | *.phtml | Start buffer |
99-
| `Buffer::end($name):void ` | *.phtml | End buffer |
100-
| `Buffer::set($name,$string):void ` | *.php | Set buffer content |
101-
| `Buffer::get($name):bool ` | *.phtml | Output buffer |
96+
| Function | Location | Purpose |
97+
| ------------------------------------------- | ------------- | ------------------ |
98+
| `Buffer::start($name):void ` | *.phtml | Start buffer |
99+
| `Buffer::end($name):void ` | *.phtml | End buffer |
100+
| `Buffer::set($name,$string):void ` | *.php | Set buffer content |
101+
| `Buffer::get($name):bool ` | *.phtml | Output buffer |
102102

103103
## Cache
104104

105-
| Function | Location | Purpose |
106-
| ------------------------------------------- | ------------- | --------------- |
107-
| `Cache::get($key):mixed ` | *.php | Get cached value |
108-
| `Cache::set($key,$val,$exp=0):bool ` | *.php | Set cache value |
109-
| `Cache::delete($key):bool ` | *.php | Delete from cache |
110-
| `Cache::add($key,$val,$exp=0):bool ` | *.php | Add if not exists |
111-
| `Cache::replace($key,$val,$exp=0):bool ` | *.php | Replace if exists |
112-
| `Cache::increment($key,$val=1):int\|false ` | *.php | Increment value |
113-
| `Cache::decrement($key,$val=1):int\|false ` | *.php | Decrement value |
105+
| Function | Location | Purpose |
106+
| ------------------------------------------- | ------------- | ------------------ |
107+
| `Cache::get($key):mixed ` | *.php | Get cached value |
108+
| `Cache::set($key,$val,$exp=0):bool ` | *.php | Set cache value |
109+
| `Cache::delete($key):bool ` | *.php | Delete from cache |
110+
| `Cache::add($key,$val,$exp=0):bool ` | *.php | Add if not exists |
111+
| `Cache::replace($key,$val,$exp=0):bool ` | *.php | Replace if exists |
112+
| `Cache::increment($key,$val=1):int\|false ` | *.php | Increment value |
113+
| `Cache::decrement($key,$val=1):int\|false ` | *.php | Decrement value |
114114

115115
## Internationalization
116116

117-
| Function | Location | Purpose |
118-
| ------------------------------------------- | ------------- | --------------- |
119-
| `I18n::translate($id):string ` | *.php | Translate string |
120-
| `I18n::price($val,$min=2,$max=2):string ` | *.php | Format price |
121-
| `I18n::currency($val,$min=2,$max=2):string ` | *.php | Format currency |
122-
| `I18n::date($str):string ` | *.php | Format date |
123-
| `I18n::datetime($str):string ` | *.php | Format datetime |
124-
| `I18n::time($h,$m,$s=0):string ` | *.php | Format time |
125-
| `I18n::duration($sec,$trim=false):string ` | *.php | Format duration |
126-
| `I18n::weekDay($day):string ` | *.php | Get weekday name |
127-
| `I18n::monthName($month):string ` | *.php | Get month name |
128-
| `I18n::datetimeShort($str):string ` | *.php | Format datetime short |
117+
| Function | Location | Purpose |
118+
| ------------------------------------------- | ------------- | ---------------------- |
119+
| `I18n::translate($id):string ` | *.php | Translate string |
120+
| `I18n::price($val,$min=2,$max=2):string ` | *.php | Format price |
121+
| `I18n::currency($val,$min=2,$max=2):string` | *.php | Format currency |
122+
| `I18n::date($str):string ` | *.php | Format date |
123+
| `I18n::datetime($str):string ` | *.php | Format datetime |
124+
| `I18n::time($h,$m,$s=0):string ` | *.php | Format time |
125+
| `I18n::duration($sec,$trim=false):string ` | *.php | Format duration |
126+
| `I18n::weekDay($day):string ` | *.php | Get weekday name |
127+
| `I18n::monthName($month):string ` | *.php | Get month name |
128+
| `I18n::datetimeShort($str):string ` | *.php | Format datetime short |

0 commit comments

Comments
 (0)