PHP code example of giordanolima / boletosphp-oo

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

    

giordanolima / boletosphp-oo example snippets


use GiordanoLima\BoletosPHP\Boletos;
$boleto = new Boletos(Boletos::BOLETOSPHP_ITAU);
$boleto->setData([...]);
$boleto->setImageBasePath("path/to/images/");
echo $boleto->render();

$boleto->setData([
    "valor_boleto" => "99,00",
    "data_vencimento" => "01/04/2016",
    "nosso_numero" => 00000001,
    (...)
]);

$boleto->setImageBasePath("http://meusite.com.br/img/boletosphp/"); // Com "/" no final

echo $boleto->render();
/* Irá imprimir um código HTML
 * <html>
 * ...
 * </html>
*/