Download the PHP package dconco/phpspa without Composer
On this page you can find all versions of the php package dconco/phpspa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dconco/phpspa
More information about dconco/phpspa
Files in dconco/phpspa
Package phpspa
Short Description A lightweight, component-based PHP library for building Single Page Applications (SPAs) without relying on heavy frontend frameworks.
License MIT
Informations about the package phpspa
๐ฆ phpSPA - Build Native PHP SPAs Without JavaScript Frameworks
๐ Name
phpSPA lets you build fast, interactive single-page apps using pure PHP โ with dynamic routing, component architecture, and no full-page reloads. No JavaScript frameworks required.
๐ฏ Goal
To empower PHP developers to create modern, dynamic web apps with the elegance of frontend SPA frameworks โ but fully in PHP.
- ๐ซ No full-page reloads
- โก Instant component swapping
- ๐งฑ Clean, function-based components
- ๐ Real SPA behavior via History API
- ๐ง Now with State Management!
๐งฑ Core Features
- ๐ Dynamic content updates โ feels like React
- ๐งฉ Component-based PHP architecture
- ๐ URL routing (client + server synced)
- ๐ง Built-in State Management
- โ๏ธ Lifecycle support for loaders, metadata, etc.
- ๐ชถ Minimal JS: one small file
- ๐ Graceful fallback (no JS? Still works)
โจ Features
- โ Fully PHP + HTML syntax
- โ No template engines required
- โ Dynamic GET & POST routing
- โ Server-rendered SEO-ready output
- โ Per-component and global loading indicators
- โ Supports Composer or manual usage
- โ State system: update UI reactively from JS
๐ง Concept
- Layout โ The base HTML (with
__CONTENT__
) - Component โ A PHP function returning HTML
- App โ Registers and runs components based on routes
- State โ Simple mechanism to manage reactive variables across requests
๐งฉ State Management
You can create persistent state variables inside your components using:
Update state from the frontend:
This will automatically re-render the component on update.
๐ฆ Installation
1. Via Composer (Recommended)
Include the autoloader:
2. Manual
Include the core files:
๐ JS Engine (CDN)
๐ Getting Started (with Live Counter)
๐ JS Events
๐ Full Documentation
Looking for a complete guide to phpSPA?
๐ Read the full tutorial and advanced usage on Read the Docs:
๐ https://phpspa.readthedocs.io
The docs include:
- ๐ฆ Installation (Composer & Manual)
- ๐งฉ Component system
- ๐ Routing & page transitions
- ๐ง Global state management
- โจ Layouts, nesting, and loaders
- ๐ก๏ธ CSRF protection
- ๐งช Practical examples & best practices
Whether you're just getting started or building something advanced, the documentation will walk you through every step.
๐ Docs & Links
- GitHub: dconco/phpspa
- JS Engine: dconco/phpspa-js
- Website: https://phpspa.readthedocs.io
- License: MIT
๐ License
MIT License ยฉ dconco
๐งโ๐ป Maintained by
Dave Conco Simple, fast, and native PHP โ just the way we like it.
๐ Give Me a Star
If you find phpSPA useful, please consider giving it a star on GitHub! It helps others discover the project and keeps the momentum going ๐
Your support means a lot! โค๏ธ