🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2.8 KiB
Executable File
2.8 KiB
Executable File
Core Framework Systems
Main_Abstract Middleware System
The framework provides application-wide middleware hooks via Main_Abstract:
Implementation
-
Create
/rsx/main.phpextendingMain_Abstractwith three methods:init()- Called once during bootstrappre_dispatch(Request $request, array $params)- Called before any route dispatchunhandled_route(Request $request, array $params)- Called when no route matches
-
Pre-dispatch flow:
- Main::pre_dispatch() called first
- Controller::pre_dispatch() called second
- If either returns non-null, dispatch halts with that response
-
Controller/API Method Signatures:
- All controller methods:
function method_name(Request $request, array $params = []) - All API methods:
function method_name(Request $request, array $params = []) $paramscontains GET query string parameters and URL-extracted route parameters (like:id)- POST data is accessed via
$request->post()or$request->input(), NOT in$params
- All controller methods:
Core JavaScript Classes
These classes are ALWAYS available - never check for their existence:
Rsx_Manifest- Manifest managementRsx_Storage- Browser storage (session/local) with scopingRsx- Core framework utilities- All classes in
/app/RSpade/Core/Js/
Use them directly without defensive coding:
// ✅ GOOD
Rsx_Manifest.define(...)
// ❌ BAD
if (typeof Rsx_Manifest !== 'undefined') {
Rsx_Manifest.define(...)
}
Dispatcher System
Maps HTTP requests to RSX controllers based on manifest data.
Autoloader System
Provides path-agnostic class loading - classes are found by name, not path.
Manifest System
Indexes all files in /rsx/ for automatic discovery and loading.
JQHTML Named Slots (v2.2.112+)
Child template syntax changed from <Slot:slotname /> tags to content('slotname') function:
- Old:
<Slot:header />(deprecated) - New:
<%= content('header') %>(v2.2.112+) - Parent syntax:
<Slot:header>content</Slot:header>
JQHTML Slot-Based Template Inheritance (v2.2.108+)
When component template contains ONLY slots (no HTML), it automatically inherits parent class template structure:
- Enables abstract base components with customizable slots
- Child templates define slot-only files to extend parent templates
- Parent templates call slots:
<%= content('slotname', data) %>(data passing supported) - JavaScript class must extend parent:
class Child extends Parent - Slot names cannot be JavaScript reserved words (enforced by parser)
JQHTML Define Tag Configuration
<Define> tag supports three attribute types:
extends="Parent"- Explicit template inheritance$property=value- Set default this.args values (unquoted=JS expression, quoted=string)- Regular HTML attributes (class, id, tag, data-*)
- Enables template-only components without JavaScript classes