mirror of
https://github.com/avecms/AVE.cms.git
synced 2026-08-01 00:45:44 +00:00
3.0 KiB
3.0 KiB
Framework helpers
A set of static utilities from system/App/Helpers/. Almost all methods
Helper::method() (state not stored). Classes autoload, use usually does not
required if the code is in the same namespace context; otherwise - use App\Helpers\Str;.
By category
Strings, arrays, numbers, date
| Helper | Destination |
|---|---|
| Str | Working with strings in UTF-8 (mbstring): case, trimming, slug, camel/snake, masking, UUID. |
| Arr | Arrays: get/set in dot notation, search, sorting, object↔array, safe (de)serialization. |
| Number | Formatting numbers, sizes, declination, number in words, float comparison. |
| Date | Date/time: SQL↔timestamp, human-readable format, declinations. |
| Locales | Locale, transliteration, translation and “beautiful” display of dates. |
HTTP: request and response
| Helper | Destination |
|---|---|
| Request | Access to incoming data: GET/POST/JSON, typed getters, method, AJAX, IP. |
| Response | Answers: JSON/HTML/text/XML, download, codes 204/404/403/401/422/429/500. |
| Cookie | Read/write/delete cookies. |
| Url | Link building, redirects, canonical, rewrite, referer. |
| Ip | Determination and validation of IP, geo-data, ip↔hex. |
| Phone | Normalization, verification and secure masking of phone numbers. |
Security and Validation
| Helper | Destination |
|---|---|
| Valid | Validation: static checks and batch check($data, $rules). |
| Secure | Cleaning input from XSS, sanitizing, processing phones. |
| Crypt | String encryption/decryption, crc32, radix conversion. |
Files and directories
| Helper | Destination |
|---|---|
| File | Files: read/write (including atomic), mime, download, encodings, names. |
| Dir | Directories: creation, crawling, size, copying, rights. |
| Zip | Archiving (ZipArchive wrapper). |
Data, output, miscellaneous
| Helper | Destination |
|---|---|
| Json | Safe encode/decode, payload for API, working with Cyrillic, “fixing” JSON. |
| Html | HTML compression, gzip output, nl2br, encode/decode, query strings. |
| Hooks | Hook system: action/filter, priorities (WordPress-like). |
| Debug | Dump/echo/print, benchmarks, time/memory measurements, SQL error output. |
| SoftDelete | SQL conditions for soft deletion (deleted_at/flags). |
| Helper | Destination |
| --- | --- |
| TagParser | Parsing tags in templates/content, registering handlers. |
| SearchText | Definition of the Cyrillic alphabet, bringing the layout to Russian. |
| RussianStemmer | Stemming of Russian words (for search). |
| MarketParser | Client of the external API MarketParser (Yandex.Market-like). |
Each file contains a purpose, a list of methods with signatures and examples.