PHP code example of paggy / boleto-bundle

1. Go to this page and download the library: Download paggy/boleto-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/ */

    

paggy / boleto-bundle example snippets



// src/Acme/DemoBundle/Controller/Payment.php
namespace Acme\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class PaymentController extends Controller
{
    public function payslipAction()
    {
        $data = array(
            'payer_name'              => 'John Doe',
            'payer_address_line1'     => 'Success Street, 108',
            'payer_address_line2'     => 'Success City, SS',
            'payslip_value'           => number_format('180', 2, ',', ''),
            'payslip_due_date'        => date('d/m/Y'),
            'payslip_document_number' => '1567',
            'payslip_description'     => 'Premium Hosting',
        );
        return new Response($this->get('paggy_boleto.view')->render($data));
    }
}
 php

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Paggy\BoletoBundle\PaggyBoletoBundle,
    );
    // ...
}