PHP code example of erdmannfreunde / contao-license-bundle

1. Go to this page and download the library: Download erdmannfreunde/contao-license-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

erdmannfreunde / contao-license-bundle example snippets


public function __construct(private LicenseManager $licenses) {}

public function renderProSlider(): string
{
    if (!$this->licenses->isValid('mail-automation')) {
        return $this->renderUpgradeNotice();
    }
    return $this->renderActualSlider();
}

use ErdmannFreunde\ContaoLicenseBundle\Attribute\RequiresLicense;

#[RequiresLicense('mail-automation')]
class ProEditorController
{
    #[Route('/contao/pro-editor/save', methods: ['POST'])]
    public function save(): Response { /* ... */ }
}