PHP has been generating HTML on the server for decades. Long before we started talking about SSR as a “modern” rendering strategy, we were already using PHP to build pages dynamically, query databases, and deliver ready-made HTML documents to the browser.
However, frontend development has changed significantly. Today, we expect interactive interfaces, smooth navigation, content that updates without reloading the entire page, and increasingly lower response times.
In this context, four rendering strategies have emerged that we have seen primarily in other ecosystems: SSR (Server-Side Rendering), CSR (Client-Side Rendering), SSG (Static Site Generation), and ISR (Incremental Static Regeneration).
The natural question is: how do these strategies fit into PHP? What role do Symfony and Laravel play? Do we necessarily need a JavaScript framework to build modern web applications?
The answer is that the PHP ecosystem offers several alternatives. Some stem directly from its original architecture, while others have evolved to deliver the interactive experiences traditionally associated with modern frontend applications.
The examples in this article reference Symfony 8.2, Laravel 13, Symfony UX Live Components 3.x, and Laravel Livewire 4.x. Some tools have release cycles independent of the main framework, so it is also worth checking their compatibility requirements.
SSR: PHP Has Always Felt at Home on the Server
Server-side rendering is probably the most natural strategy for PHP.
In SSR, the server receives a request, executes the corresponding logic, retrieves the necessary data, and generates the HTML document that ultimately reaches the browser.
This is exactly what we do when using PHP traditionally:
<?php
$products = $repository->findAll();
?>
<!DOCTYPE html>
<html lang="es">
<head>
<title>Catálogo de productos</title>
</head>
<body>
<h1>Nuestros productos</h1>
<?php foreach ($products as $product): ?>
<article>
<h2><?= htmlspecialchars($product->name) ?></h2>
<p><?= htmlspecialchars($product->description) ?></p>
</article>
<?php endforeach; ?>
</body>
</html>
The browser doesn’t need to run JavaScript to know what products exist or to build the initial structure of the page. It receives HTML with the content already rendered.
Modern frameworks maintain this exact same principle, although they separate concerns better.
Symfony and Twig
In Symfony, a controller processes the request and can delegate HTML response generation to Twig:
#[Route('/productos/{id}', name: 'producto_show')]
public function show(Product $product): Response
{
return $this->render('product/show.html.twig', [
'product' => $product,
]);
}
The Twig template handles presenting the data:
<h1>{{ product.name }}</h1>
<p>{{ product.description }}</p>
<strong>{{ product.price }} €</strong>
Symfony generates the HTML on the server and delivers it to the browser.
Laravel and Blade
Laravel follows a very similar philosophy with Blade:
Route::get('/productos/{product}', function (Product $product) {
return view('products.show', compact('product'));
});
And its template:
<h1>{{ $product->name }}</h1>
<p>{{ $product->description }}</p>
<strong>{{ $product->price }} €</strong>
Both Twig and Blade allow separating presentation logic from business logic while keeping rendering on the server.
A major advantage of this approach is that the initial HTML already contains the required content. This benefits initial page loads, accessibility, and the indexing of public content.
However, SSR doesn’t mean we have to query the database and rebuild every page on every single request. This is where caching strategies come in, allowing us to reuse responses that were already generated previously.
CSR: When the Browser Takes Over the Work
Client-Side Rendering shifts the responsibility of building the UI to the browser.
Instead of delivering a complete HTML page, the server can return a minimal initial structure alongside the JavaScript bundles required for a frontend application to render the content.
A common example is an SPA built with Vue.js or React that consumes an API developed with Symfony or Laravel.
The architecture typically looks like this:
Navegador
|
| Carga aplicación JavaScript
|
v
Vue.js / React
|
| Solicitudes HTTP
|
v
API Symfony / Laravel
|
v
Base de datos
Inertia.js: A Middle Ground
An especially interesting case is Inertia.js, particularly within the Laravel ecosystem.
Inertia allows building applications with an SPA-like navigation experience without forcing us to build an independent REST API for every screen.
The server still uses traditional controllers and routes. Instead of returning a different HTML template for each navigation, it returns responses with the data needed for the frontend to update the corresponding component.
For instance, a Laravel controller can return:
public function index()
{
return Inertia::render('Products/Index', [
'products' => Product::all(),
]);
}
The Vue component receives that data as props:
<script setup>
defineProps({
products: Array
});
</script>
<template>
<h1>Productos</h1>
<article v-for="product in products" :key="product.id">
<h2>{{ product.name }}</h2>
</article>
</template>
On an initial visit, Laravel can deliver the HTML document along with the data needed for the browser to render the page. On subsequent navigations, the client uses the Inertia protocol to request data for the next page and update the interface without a full document reload.
Inertia also supports SSR through a server-side rendering process. In that scenario, the JavaScript frontend renders the initial HTML before sending it to the browser.
Laravel 13 maintains this integration in its official starter kits, which use Inertia 3 for Vue, React, and Svelte options.
Therefore, we shouldn’t automatically categorize an Inertia application as purely CSR. The difference lies in how the initial response is generated and how subsequent navigations are handled.
Interactivity Without Building a Full SPA
Here lies one of the most interesting evolutions in the PHP ecosystem.
For a long time, adding interactivity to a server-rendered application meant writing JavaScript, setting up AJAX endpoints, and manually managing DOM updates.
Tools like Symfony UX Live Components and Laravel Livewire offer an alternative: keeping much of the interaction logic in PHP.
Symfony UX Live Components
Symfony UX Live Components allows building interactive components using PHP and Twig.
A component can hold state (properties), respond to user actions, and re-render when its state changes.
For example, consider a product search:
namespace App\Twig\Components;
use App\Repository\ProductRepository;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveProp;
use Symfony\UX\LiveComponent\DefaultActionTrait;
#[AsLiveComponent]
class ProductSearch
{
use DefaultActionTrait;
#[LiveProp(writable: true)]
public string $query = '';
public function __construct(
private ProductRepository $repository
) {
}
public function getProducts(): array
{
return $this->repository->search($this->query);
}
}
In Twig, we can use that property to display the results:
<div {{ attributes }}>
<input
type="search"
data-model="query"
placeholder="Buscar productos..."
>
{% for product in this.products %}
<article>
<h2>{{ product.name }}</h2>
</article>
{% endfor %}
</div>
There are two important details in this example.
First, #[LiveProp(writable: true)] allows the browser to modify the query property. Component properties are read-only for the client by default; enabling write access must be an explicit decision.
Second, getProducts() is exposed in Twig as a computed property via this.products. This allows us to query the repository using the component’s current state.
When the user modifies the input, Symfony UX Live Components can send a request to the server, update the component’s state, and return the HTML needed to update the UI. The data-model binding uses an automatic 150-millisecond debounce to avoid sending a request on every keystroke.
We don’t need to manually implement all the communication between JavaScript and PHP.
Laravel Livewire
Laravel Livewire proposes a similar philosophy.
It enables building interactive components using PHP and Blade, keeping much of the UI logic on the server.
A search component might look like this:
namespace App\Livewire;
use App\Models\Product;
use Livewire\Component;
class ProductSearch extends Component
{
public string $query = '';
public function render()
{
return view('livewire.product-search', [
'products' => Product::where(
'name',
'like',
'%' . $this->query . '%'
)->get(),
]);
}
}
And its template:
<div>
<input
type="search"
wire:model.live="query"
placeholder="Buscar productos..."
>
@foreach ($products as $product)
<article>
<h2>{{ $product->name }}</h2>
</article>
@endforeach
</div>
Livewire detects changes, sends the corresponding requests, and updates the affected part of the interface.
In Livewire 4, there is an important distinction between wire:model and wire:model.live:
wire:modelsyncs the value with the server when an action is triggered—for example, when submitting a form.wire:model.livesends updates as the user types, applying a default debounce of 150 milliseconds.
This difference lets you control how many requests a component generates and prevents unnecessary server load.
Is This SSR or CSR?
This is an intriguing question because these tools don’t fit neatly into a single category.
Both Symfony UX Live Components and Livewire start with server-rendered components. However, they incorporate a communication mechanism that allows updating parts of the UI after the initial page load.
They are not equivalent to a traditional SPA, because component logic still runs predominantly on the server.
Nor are they simply static SSR pages, because they allow dynamic interactions without reloading the full document.
In a sense, they represent an evolution of the traditional server-rendered model: they keep PHP at center stage while using JavaScript as a communication and update vehicle.
Symfony UX Turbo also shares this philosophy, though it solves different problems. Turbo Drive speeds up page navigation, Turbo Frames lets you update specific fragments, and Turbo Streams makes it easy to stream HTML updates.
We don’t need to turn the entire application into an SPA to achieve a smoother browsing experience.
That said, these solutions come with trade-offs: interactions depend on the network, every request can incur additional server load, and we must factor in concurrency, component state, and latency.