PHPackages                             setono/prerender-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. setono/prerender-bundle

ActiveSymfony-bundle[API Development](/categories/api)

setono/prerender-bundle
=======================

A Symfony bundle that integrates 'prerender' services, i.e. rendertron or prerender.io

v0.1.0(4y ago)15.2k1[1 issues](https://github.com/Setono/PrerenderBundle/issues)[1 PRs](https://github.com/Setono/PrerenderBundle/pulls)1MITPHPPHP &gt;=7.4

Since Jan 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Setono/PrerenderBundle)[ Packagist](https://packagist.org/packages/setono/prerender-bundle)[ RSS](/packages/setono-prerender-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (18)Versions (6)Used By (1)

Symfony Prerender Bundle
========================

[](#symfony-prerender-bundle)

[![Latest Version](https://camo.githubusercontent.com/2c5a733b01dd63ffcd6b01559f1422c0fc871baf8f326657fc98a3a03f2868db/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f70726572656e6465722d62756e646c652f762f737461626c65)](https://packagist.org/packages/setono/prerender-bundle)[![Software License](https://camo.githubusercontent.com/8df69f9196eb6792544d8ebf4a4f256ed5df6584f92af7687523ae0f86163f5a/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f70726572656e6465722d62756e646c652f6c6963656e7365)](LICENSE)[![Build Status](https://github.com/Setono/PrerenderBundle/workflows/build/badge.svg)](https://github.com/Setono/PrerenderBundle/actions)

Use this bundle to (pre)render a request or URL. This is useful if you render your page using javascript and want to show the HTML output of that page to Googlebot or other clients not very fond of javascript.

See Googles own help page on this topic: [Implement dynamic rendering](https://developers.google.com/search/docs/advanced/javascript/dynamic-rendering).

Installation
------------

[](#installation)

To install this bundle, simply run:

```
composer require setono/prerender-bundle
```

This will install the bundle and enable it if you're using Symfony Flex. If you're not using Flex, add the bundle manually to `bundles.php` instead.

Configuration
-------------

[](#configuration)

The bundle is already preconfigured for you if you want to use the [open source version of prerender.io](https://github.com/prerender/prerender). Then you just need to run that service. However, you can configure it easily like so:

```
# config/packages/setono_prerender.yaml
setono_prerender:
    adapter:
        prerender: 'http://your-prerender-url.com'
```

If you want to create your own prerenderer service, just implement the [`PrerendererInterface`](src/Prerenderer/PrerendererInterface.php)and tag your service with `setono_prerender.prerenderer`. Then in the configuration of the bundle do this:

```
# config/packages/setono_prerender.yaml
setono_prerender:
    prerenderer: 'the-service-id-of-your-prerenderer-service'
```

Usage
-----

[](#usage)

Here is a very basic example of a product controller where we want to render the index action:

```
