Skip to content

Why Inertia?

When teams want interactive React, Vue, or Svelte interfaces in ProcessWire, they usually hit a fork in the road: either sprinkle isolated scripts onto server-rendered PHP templates, or build a decoupled frontend that duplicates routing, authentication, validation, and data fetching over a REST API.

Inertia bridges both worlds. ProcessWire remains the single source of truth for URLs, permissions, selectors, and forms, while your JavaScript framework handles the view layer.

Comparing ProcessWire Frontend Architectures

Section titled “Comparing ProcessWire Frontend Architectures”
Aspect Classic Templates Inertia Hybrid Mode Inertia Full SPA Mode
Routing & Access Control ProcessWire Page Tree ProcessWire Page Tree ProcessWire Page Tree
View Layer PHP templates / Markup Regions Classic PHP + Inertia on selected templates React, Vue, or Svelte across all frontend templates
API Boilerplate None None (props passed directly from PHP) None (props passed directly from PHP)
Authentication & CSRF Native $user & $session->CSRF Native $user & $session->CSRF Native $user & $session->CSRF
Client-Side Page Transitions Full browser reload SPA transitions between Inertia templates SPA transitions across the entire site
SEO & Initial HTML Server-rendered HTML Server-rendered HTML or SSR Server-rendered HTML or SSR
TypeScript Safety Manual Auto-generated inertia.d.ts Auto-generated inertia.d.ts

Hybrid Mode (mode = 'selected') is the default because it lets you modernize an existing ProcessWire site without rewriting working pages:

  1. Zero disruption to Markup Regions: Inertia sets $template->noAppendTemplateFile = true only on templates enabled for Inertia. It never mutates $config->useMarkupRegions globally, so classic templates keep using _main.php untouched.
  2. Incremental adoption: Start with an interactive search directory, booking flow, or account dashboard while leaving marketing pages in classic PHP.
  3. Shared foundation for admin modules: First-party modules such as React build directly on top of Inertia using ProcessInertia, MarkupInertia, and InputfieldInertia.

Switch to Full SPA Mode (mode = 'all') when every frontend template on the site is rendered by your JavaScript framework and you want instant client-side navigation across every link.

Next steps