Screenshots
composer require --dev symfony/panther
composer require --dev dbrekelmans/bdi && vendor/bin/bdi detect driversImage Processor
Using PHP Attributes
<?php
namespace App\Controller;
use SpomkyLabs\PwaBundle\Attribute\Screenshot;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class HomeController extends AbstractController
{
#[Route('/', name: 'app_homepage')]
#[Screenshot(
sizes: ['fhd', 'ipad/LP', 'iphone-14'],
name: 'homepage',
label: 'Application homepage',
platform: 'windows'
)]
public function index(): Response
{
return $this->render('home/index.html.twig');
}
}Generating Screenshots
Attribute Parameters
Parameter
Type
Required
Description
Automatic Manifest Integration
Multi-Locale Support
Routes with Parameters
Size Profiles
Available Size Profiles
Standard Resolutions (Landscape)
Profile
Dimensions
Form Factor
Portrait Resolutions
Profile
Dimensions
Form Factor
iPhone Models
Profile
Dimensions
Form Factor
Android Devices
Profile
Dimensions
Form Factor
Tablets
Profile
Dimensions
Form Factor
Web Breakpoints
Profile
Dimensions
Form Factor
Configuration
User Agent
Custom Web Client
Last updated
Was this helpful?