AI blog · DotApp PHP Framework 2.0
Návody pre ľudí aj pre kódujúcich agentov
Kompletné návody s kódom na skopírovanie na ultralahkom jadre napísanom od nuly: moduly, config.php, cache, DSM, zabezpečené formuláre, Bridge a $dotapp.js. Každý článok má vlastnú URL, aby si agent mohol stiahnuť jednu tému.
Novinky
Aplikácia a moduly
How to create a module in DotApp PHP Framework
Scaffold a module with DotApper, register routes in initialize(), and ship Config::module fallbacks so the module stays portable.
Čítať článokHow app/config.php works in DotApp PHP Framework
One file configures the app and every module: databases, drivers, secrets, and Config::module overrides without editing module folders.
Čítať článokHow module initialization works in DotApp PHP Framework
Boot order from index.php through listeners, initializeCondition, initialize(), and lazy loading with two maps: Module::initializeRoutes() and Listeners::initializeRoutes().
Čítať článokHow independent listener routes work in DotApp PHP Framework
Listeners::initializeRoutes() is a separate wake-up map from Module::initializeRoutes(). Optimizer v2 writes both. Old modules and old cache files stay compatible.
Čítať článok
Cache a session
How to use cache in DotApp PHP Framework
Cache::use, save and load, File Redis Memcached and Null drivers, context keys, TTL, and the return value of a miss.
Čítať článokHow to use sessions in DotApp PHP Framework (DSM)
Application state belongs in DSM::use(Module), never in $_SESSION. Drivers, reserved keys, and config.php registration.
Čítať článok
Bezpečný kanál prehliadača
How DotApp PHP Framework protects the browser-to-PHP channel
Per-session key, app.c_enc_key, extra keys, key update, formName, crcCheck, encrypted ids — why a lone CSRF token is a narrow guarantee.
Čítať článokHow to create secure forms in DotApp PHP Framework
fo-rm, formName between the tags, crcCheck, data() vs data(true), and $request->form() with a complete copy-paste module example.
Čítať článokSecure backend-frontend communication in DotApp PHP Framework
When to use fo-rm, $dotapp().load(), Bridge, or uploadFile. PHP still checks rights after a successful crcCheck.
Čítať článok
Dáta a HTTP
How to use the database in DotApp PHP Framework
DB::module RAW with named bindings (:iduser). Every ? in raw() is a placeholder including COMMENT. QueryBuilder, paginate, transactions.
Čítať článokHow routing works in DotApp PHP Framework
Router::get and post, STATIC_ROUTE, path constraints, {not:mask} excludes, callable strings, before hooks, JSON endpoints, and named RAW lookups.
Čítať článokHow URL {not:} selectors work in DotApp PHP Framework
{not:mask|mask} excludes before the positive match. Same grammar on routes, before hooks, and initializeRoutes() wake strings. /admin* is not /admin/*.
Čítať článokRequest lifecycle in DotApp PHP Framework
data() is the protected copy; data(true) is original. query vs matchData, crcCheck, form(), ajaxReply HTTP 400 vs .after().
Čítať článokHow to render views and layouts in DotApp PHP Framework
Renderer::new, view and layout files, {{ var: }} directives, silent empty output, assets, and translations.
Čítať článokHow to use blocks and superblocks in DotApp PHP Framework
addBlock plus {{ block: }}. Superblocks are {{ privateblock }} plus $block[name]->set()->html() compiled with renderCode(). No {{ sblock: }} in the kernel.
Čítať článokHow translations and i18n work in DotApp PHP Framework
Translator::loadLocaleFile, {{_ }} helper, lowercase keys, silent missing files, no pluralization, product copy in JSON.
Čítať článokHow authentication and 2FA work in DotApp PHP Framework
Auth::login return shapes, stages, Auth::can, TOTP, data(true) for passwords, and $dotapp().twoFactor. Auth::logged() does not exist.
Čítať článokHow to create database migrations with Installation.php in DotApp PHP Framework
Versioned Installation.php, alreadyDone and markDone. No ? in SQL comments inside raw() — every ? is a placeholder. DB::migrate() is not implemented.
Čítať článok
HTTP a životný cyklus aplikácie
Controllers and Response in DotApp PHP Framework
Static controller methods, return HTML or Response::json / redirect / ajaxReply. Trailing ! skips DI. Missing views return empty string.
Čítať článokHow to build JSON endpoints with Router in DotApp PHP Framework
One Router::get or post per verb. Return Response::json. Do not use apiPoint. Channel posts still need crcCheck and ajaxReply.
Čítať článokMiddleware in DotApp PHP Framework
Route before hooks vs named Middleware::register pipelines vs #Shop:AuthGate@check!. Do not mix callback shapes.
Čítať článokDependency injection in DotApp PHP Framework
bind, singleton, resolve (throws if unbound). Type-hints only without trailing !. Do not use Injector::.
Čítať článokEvents and listeners in DotApp PHP Framework
module.listeners.php first. trigger() returns the original payload. Listener returns are ignored. triggerWithVeto() plus Veto is the opt-in stop. Names are lowercased. dotapp.catchall fires first on every other trigger (debug tap).
Čítať článokHow trigger with veto works in DotApp PHP Framework
Events::triggerWithVeto() and the Veto class. Only an explicit Veto object stops dispatch. Ordinary trigger() still ignores returns, including a Veto.
Čítať článokHow Extender works in DotApp PHP Framework
Judged, request-local method replacement. The owner uses exists() / call(); original() can explicitly defer to owner logic. Subscribe to shop.loading, then extend() with a controller string.
Čítať článokBuilt-in events and database triggers in DotApp PHP Framework
Catalog of kernel Events: dotapp.catchall debug tap, module lifecycle, router, SQL execute/success/error, logger, and the CSRF replacement hook. ORM observe() is separate.
Čítať článokError handling and return values in DotApp PHP Framework
Four failure styles: execute callbacks, null/false, envelopes, exceptions. Validator arrays are truthy. Missing views are empty string.
Čítať článok
JavaScript a Bridge
How to build AJAX lists with pagination in DotApp PHP Framework
paginate() plus $dotapp().load(), overlay, live DOM patch, encrypted ids. QueryBuilder or named RAW bindings. No full-page ?page= reloads.
Čítať článokHow to call PHP from JavaScript with DotBridge
Bridge::listen, template on(click), filters, and rate limits on the same secure channel.
Čítať článokCallable strings in DotApp PHP Framework
Module:Class@method!, # middleware, * models, when to skip DI, and DotApp::call().
Čítať článokHow to use $dotapp() JavaScript in DotApp PHP Framework
Mandatory /assets/dotapp/dotapp.js, boot events, selectors, live(), parseReply(), and preloaders.
Čítať článokReactivity in DotApp PHP Framework
dotapp.reactive.js: variable, databind, computed, reactive-api attributes, and the PHP Reactive helper.
Čítať článok