⚡ php-via Examples

Live Interactive Examples

🚀 About These Examples

Each example runs as a separate Swoole server instance on its own port. This lets you explore different php-via features in isolation, compare approaches, and run multiple examples simultaneously. The cards below show live status indicators—click any card to open the example in a new tab.

⚡ Real-time updates using Server-Sent Events (SSE) for instant synchronization

🎯 Flexible scoping - Global, Route, Tab, and Custom scopes for different sharing needs

🔄 Reactive signals that automatically sync state between server and UI

🤝 Multiplayer by default - many examples share state across all connected clients

⚡ Counter

/counter
Basic counter with increment button. Uses signals with data binding and actions. Shows SSE with debug sidebar.
Beginner HTML Source

🔢 Counter Basic

/counter-basic
Simplest counter example. Demonstrates minimal Via setup with inline Twig rendering and reactive signals.
Beginner TWIG Source

👋 Greeter

/greeter
Interactive greeting buttons. Shows Twig templates, multiple actions, and signal updates with SSE.
Beginner TWIG Source

✓ Todo List

/todo
Multiplayer todo app—one shared list for all clients! Uses route scope, CRUD operations, and mixed tab/route scoped signals.
Intermediate TWIG Source

🧩 Components

/components
Three independent counter components. Demonstrates component abstraction with namespaced signals and Twig partials.
Intermediate TWIG Source

💬 Chat Room

/chat
Multi-room chat system. Features custom room scopes, session-based usernames, typing indicators, and real-time broadcasting.
Advanced TWIG Source

🎮 Game of Life

/gameoflife
Multiplayer Conway's Game of Life—everyone sees and controls the same board! Uses route scope, timer-based updates, and view caching.
Advanced HTML Source

🔔 Global Notifications

/notifications
System-wide notification banner. Demonstrates global scope with globalState() and broadcasting across all routes.
Advanced HTML Source

📈 Stock Ticker

/stocks
Multiplayer stock tracker—all clients see the same live prices! Uses route-scoped path parameters, ECharts visualization, and timer-based updates.
Advanced TWIG Source

� Client Monitor

/monitor
Live connected clients viewer with identicons and server stats. Shows route scope broadcasting, render statistics, and real-time client monitoring.
Intermediate HTML Source

🛣️ Path Parameters

/path-params
Dynamic routing showcase. Demonstrates path parameter extraction with multiple route patterns and inline styling.
Intermediate HTML Source

📊 All Scopes Demo

/all-scopes
Complete scope comparison. Shows global, route, and tab scopes working together in a single multi-page application.
Intermediate HTML Source