Skip to main content

Initial Quanta

After installation, initialize the framework by creating a basic setup. This step prepares Quanta to handle actions, routes, and components.

error_reporting(E_ALL);
ini_set('display_errors', 1);

require 'vendor/autoload.php';
use Quanta\Quanta;

// Step 1: Instantiate Quanta
$quanta = new Quanta();
$quanta->redirect403(); // Redirect unauthorized users to a 403 page if needed

// Step 2: Include necessary files
require("inc/components.php"); // Load your components
require("inc/actions.php"); // Define your actions
require("inc/routes.php"); // Set up your routes

// Step 3: Initialize the Action Handler
$quanta->actionHandler->init();

// Step 4: Process the action
$quanta->processAction(true);

// Step 5: Prepare the environment
$quanta->prepareEnvironment();