Routing & Architecture

ArtiFrame utilizes a completely unique Dual Bootstrapper Architecture. This completely prevents HTML/JSON header collisions, which is a common vulnerability in traditional MVC frameworks.

The Dual Bootstrapper

1. ViewControl.php

Used exclusively for HTML pages (Views). It safely initializes the Session, injects CSRF tokens, and loads `ViewMethod` helpers.

public/profile.php
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/../app/ViewControl.php';
use Bin\ViewMethod;
?>
<!DOCTYPE html>
<html>...</html>

2. ApiControl.php

Used exclusively for API endpoints. It forces `application/json` headers, strictly validates allowed HTTP methods, and securely loads `SystemMethod`.

public/api/users.php
<?php
$allowedMethods = ['GET'];
require_once $_SERVER['DOCUMENT_ROOT'] . '/../app/ApiControl.php';
use Bin\SystemMethod;

// API Logic...
Critical: Never mix ViewControl and ApiControl. Requiring ViewControl in an API endpoint will corrupt the JSON response with HTML headers.