PHPackages                             sqweb/symfony\_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. [Payment Processing](/categories/payments)
4. /
5. sqweb/symfony\_bundle

Abandoned → [mltpss/symfony-bundle](/?search=mltpss%2Fsymfony-bundle)Symfony-bundle[Payment Processing](/categories/payments)

sqweb/symfony\_bundle
=====================

SQweb package for Symfony users

v1.3.4(8y ago)044[1 issues](https://github.com/SQweb-team/SQweb-SDK-Symfony/issues)MITPHPPHP &gt;=5.5.0

Since Oct 12Pushed 8y agoCompare

[ Source](https://github.com/SQweb-team/SQweb-SDK-Symfony)[ Packagist](https://packagist.org/packages/sqweb/symfony_bundle)[ RSS](/packages/sqweb-symfony-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)Dependencies (4)Versions (16)Used By (0)

SQweb Symfony Package
=====================

[](#sqweb-symfony-package)

[![Build Status](https://camo.githubusercontent.com/7f2f8f6a2ec6c3a2c3c9032422aad2764aac1e1c24f64a65ffa439f18cbe823c/68747470733a2f2f7472617669732d63692e6f72672f53517765622d7465616d2f53517765622d53444b2d53796d666f6e792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SQweb-team/SQweb-SDK-Symfony)

**This package allows you to easily integrate SQweb on your Symfony powered website.**

Requirements
------------

[](#requirements)

**This SDK has been tested with PHP 5.5 and greater.**

We are unable to provide official support for earlier versions. For more information about end of life PHP branches, [see this page](http://php.net/supported-versions.php).

Install
-------

[](#install)

**This package is intended for websites powered by Symfony.**

If you're using WordPress, we've made it easy for you. Download the SQweb plugin [directly from WordPress.org](https://wordpress.org/plugins/sqweb/), or check out the source [here](https://github.com/SQweb-team/SQweb-WordPress-Plugin).

### Using Symfony 3.x

[](#using-symfony-3x)

1. In your project root, execute `composer require mltpss/symfony-bundle`. Now, go to `app/AppKernel.php` and add this line to your bundles array:

    ```
    new SQweb\SQwebBundle\SQwebSQwebBundle()
    ```
2. Add in your `app/config/config.yml` after `# Twig configuration`

    ```
    twig:
        globals:
        	sqweb: "@s_qweb_s_qweb.SQweb"

    ```
3. And at the end of your `config.yml` add :

    ```
    # SQweb | Multipass Configuration
    s_qweb_s_qweb:
      config:
        id_site: 00000
        sitename: "website_name"
        debug: false
        targeting: false
        beacon: false
        dwide: false
        autologin: true
        lang: "en_US"
        message: ""
        login: ""
        support: ""
        connected: ""
        btn_noads: ""
        login_tiny: ""
        connected_s: ""
        btn_unlimited: ""
        connected_tiny: ""
        connected_support: ""

    ```

**Don't forget to set your `id_site`, `sitename` and `lang` accordingly.**

For additional settings, see "[Options](#options)" below.

### Using Symfony 4.x

[](#using-symfony-4x)

1. Be sure you are using the twig bundle, if not, execute the following command in your project root: `composer require twig`
2. Now go to `packages/twig.yaml` and copy paste the following piece of code. Be sure to use your real id\_site on this line: `id_site: 00000` and replace `"website_name"` with your actual website name.

    ```
    twig:
       [...]

    	globals:
      	  sqweb: "@s_qweb_s_qweb.SQweb"

    # SQweb | Multipass Configuration
    s_qweb_s_qweb:
      config:
        id_site: 00000
        sitename: "website_name"
        debug: false
        targeting: false
        beacon: false
        dwide: false
        autologin: true
        lang: "en_US"
        message: ""
        login: ""
        support: ""
        connected: ""
        btn_noads: ""
        login_tiny: ""
        connected_s: ""
        btn_unlimited: ""
        connected_tiny: ""
        connected_support: ""

    ```

    **Don't forget to set your `id_site`, `sitename` and `lang` accordingly.**

    For additional settings, see "[Options](#options)" below.
3. In your project root, execute `composer require mltpss/symfony-bundle`.

Usage
-----

[](#usage)

### 1. Tagging your pages

[](#1-tagging-your-pages)

This function outputs the SQweb JavaScript tag. Insert it before the closing `` tag in your HTML.

```
{{ sqweb.script|raw }}
```

**If you previously had a SQweb JavaScript tag, make sure to remove it to avoid any conflicts.**

### 2. Checking the credits of your subscribers

[](#2-checking-the-credits-of-your-subscribers)

This variable is `true` if the user subscribe to multipass and `false` if not, so that you can disable ads and/or unlock premium content.

Use it like this:

```
{% if sqweb.abo %}
    //CONTENT
{% else %}
    //ADS
{% endif %}
```

### 3. a) Showing the Multipass button

[](#3-a-showing-the-multipass-button)

Finally, use this code to display the Multipass button on your pages:

```
{{ sqweb.button|raw }}
```

We have differents size for the button here is how to use them e.g:

```
{{ sqweb.buttonTiny|raw }}
OR
{{ sqweb.buttonSlim|raw }}
OR
{{ sqweb.buttonLarge|raw }}
```

[![Example Buttons](https://camo.githubusercontent.com/5cba7f1591059cc7aa093b60c7ff8efe41fb33aa287e9f0cfaa471b545736eb1/68747470733a2f2f63646e2e6d756c7469706173732e6e65742f6769746875622f627574746f6e734032782e706e67 "Example Buttons")](https://camo.githubusercontent.com/5cba7f1591059cc7aa093b60c7ff8efe41fb33aa287e9f0cfaa471b545736eb1/68747470733a2f2f63646e2e6d756c7469706173732e6e65742f6769746875622f627574746f6e734032782e706e67)

### 3. b) Customizing the Multipass button

[](#3-b-customizing-the-multipass-button)

If you want to customize our different type of button, edit the following in your `config.yaml` file.

For instance:

```
# SQweb Configuration
s_qweb_s_qweb:
    config:
		...
		login:"Hello world"
		...
```

Will display `Hello world` instead of `Premium with Multipass` on the regular button for logged out visitors.

Button ModelLogged inLogged outTiny`connected_tiny``login_tiny`Regular`connected``login`Large - before black dotN / A`btn_unlimited`Large - after black dotN / A`btn_noads`Large connected`connected_s`N / A### 4. More functions

[](#4-more-functions)

#### Display a support div for your users

[](#display-a-support-div-for-your-users)

```
/**
 * Display a support block.
 */

function supportBlock() {   }
``

For instance:

```php
{{sqweb.supportBlock|raw}}
```

Will display the block.

#### Display a locking div for your users

[](#display-a-locking-div-for-your-users)

```
/**
 * Display a locking block.
 */

function lockingBlock() {   }
``

For instance:

```php
{{sqweb.lockingBlock|raw}}
```

Will display the block. We recommand you to use it in combination with our other limiting fuctions, like this:

```
{% if sqweb.waitToDisplay('2016-09-15', 2) %}
    // The content here will appear the 2016-09-17, 2 days after the publication date for non paying users.
{% else %}
    // Here you can display a message that free users will see while your article is not displayed
    {{sqweb.lockingBlock|raw}}
{% endif %}
```

#### Display only a part of your content to non premium users

[](#display-only-a-part-of-your-content-to-non-premium-users)

```
/**
 * Put opacity to your text
 * Returns the text with opcaity style.
 * @param text, which is your text.
 * @param int percent which is the percent of your text you want to show.
 * @return string
 */

public function transparent($text, $percent = 100) { ... }
```

Example:

```
{{ sqweb.transpartext('one two three four', 50)|raw }}
```

Will display for free users:

```
one two

```

#### Display your content later for non paying users

[](#display-your-content-later-for-non-paying-users)

```
/**
 * Display your premium content at a later date to non-paying users.
 * @param  string  $date  When to publish the content on your site. It must be an ISO format(YYYY-MM-DD).
 * @param  integer $wait  Days to wait before showing this content to free users.
 * @return bool
 */

public function waitToDisplay($date, $wait = 0) { ... }
```

Example:

```
{% if sqweb.waitToDisplay('2016-09-15', 2) %}
    // The content here will appear the 2016-09-17, 2 days after the publication date for non paying users.
{% else %}
    // Here you can display a message that free users will see while your article is not displayed
{% endif %}
```

#### Limit the number of articles free users can read per day

[](#limit-the-number-of-articles-free-users-can-read-per-day)

```
/*
 * @param int $limitation  Number of articles a free user can see.
 */

function limitArticle($limitation = 0) { ... }
```

For instance, if I want to display only 5 articles to free users:

```
{% if sqweb.limitArticle(5) %}
    // Put your content here
{% else %}
    // Here you can display a message that free users will see while your article is not displayed
{% endif %}
```

Options
-------

[](#options)

Unless otherwise noted, these options default to `false`. You can set them in your configuration file eg: `config.yml`.

OptionDescription`id_site`Sets your website SQweb ID. Ex: 123456.`sitename`The name that will appear on the large version of our button. You must set this variable.`debug`Output various messages to the browser console while the plugin executes.`dwide`Set to `false` to only enable SQweb on the current domain. Defaults to `true`.`lang`You may pick between `en_US`, and `fr_FR`.`autologin`Automatically login Multipass users on your website.Contributing
------------

[](#contributing)

We welcome contributions and improvements.

### Coding Style

[](#coding-style)

All PHP code must conform to the [PSR2 Standard](http://www.php-fig.org/psr/psr-2/).

Bugs and Security Vulnerabilities
---------------------------------

[](#bugs-and-security-vulnerabilities)

If you encounter any bug or unexpected behavior, you can either report it on Github using the bug tracker, or via email at `hello@sqweb.com`. We will be in touch as soon as possible.

If you discover a security vulnerability within SQweb or this plugin, please e-mail `security@sqweb.com`. Vulnerabilities will be promptly addressed.

License
-------

[](#license)

Copyright (C) 2016 – SQweb

This program is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details

You should have received a copy of the GNU General Public License along with this program. If not, see .

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 65.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~23 days

Total

15

Last Release

2951d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04d8f4c2cae1b0fce66983646d40d2f682bab0e6de986f4456f7e22df7df6d15?d=identicon)[sqweb](/maintainers/sqweb)

---

Top Contributors

[![PierreLvx](https://avatars.githubusercontent.com/u/6901783?v=4)](https://github.com/PierreLvx "PierreLvx (23 commits)")[![NicolasVdk](https://avatars.githubusercontent.com/u/10002644?v=4)](https://github.com/NicolasVdk "NicolasVdk (12 commits)")

---

Tags

subscriptionpaywallmultipasssqweb

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sqweb-symfony-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sqweb-symfony-bundle/health.svg)](https://phpackages.com/packages/sqweb-symfony-bundle)
```

###  Alternatives

[unicodeveloper/laravel-paystack

A Laravel Package for Paystack

650975.6k11](/packages/unicodeveloper-laravel-paystack)[payum/core

One million downloads of Payum already! Payum offers everything you need to work with payments. Friendly for all PHP frameworks (Symfony, Laravel, Laminas, Yii, Silex). Check more visiting site.

484.8M173](/packages/payum-core)[payum/stripe

The Payum extension. It provides Stripe payment integration.

22573.1k3](/packages/payum-stripe)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

7812.3k](/packages/danestves-laravel-polar)[yanlongli/app-store-server-api

PHP client for App Store Server API. Manage your customers’ App Store transactions from your server.The App Store Server API is a REST API that you call from your server to request and provide information about your customers' in-app purchases. The App Store signs the transaction and subscription renewal information that this API returns using the JSON Web Signature (JWS) specification.App Store Server API is independent of the app’s installation status on the customer’s devices. The App Store server returns information based on the customer’s in-app purchase history regardless of whether the customer installed, removed, or reinstalled the app on their devices.To request transaction and subscription status information with this API, provide any original transaction identifier that belongs to the customer. The transaction history API responds with a complete list of transactions, 20 at a time, starting with the oldest first. The subscription status API returns the status for all of the customer’s subscriptions, organized by their subscription group identifier.Use the Send Consumption Information endpoint to send information to the App Store when customers request a refund for a consumable in-app purchase, after you receive the CONSUMPTION\_REQUEST App Store server notification. Your data helps inform refund decisions.

2532.0k](/packages/yanlongli-app-store-server-api)[msonowal/laravel-razor-pay-cashier

Laravel Cashier provides an expressive, fluent interface to Razorpay's subscription billing services.

2625.3k](/packages/msonowal-laravel-razor-pay-cashier)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
