PHP code example of knevelina / prolite

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

    

knevelina / prolite example snippets



use Knevelina\Prolite\Display;

$display = new Display(1);

$display->getGraphicsBank();
$display->getPageBank();
$display->getTimerBank();

$config = $display->getConfiguration();

$pageBank = $display->getPageBank();

$pageBank->hasPage(0); // false
$pageBank->setPage(0, 'Hello, world!');
$pageBank->hasPage(0); // false
$pageBank->getPage(0); // Hello, world!

use Knevelina\Prolite\Models\Graphic;

$graphicsBank = $display->getGraphicsBank();

$graphicsBank->setGraphic(0, new Graphic('RGYB...'));

$display->getPageBank()->setPage(0, 'Hello, world! <BA>');

$graphicsBank->getGraphic(0);
$graphicsBank->getGraphic(1); // Returns the default graphic at index 1.

$timerBank = $display->getTimerBank();

$timerBank->hasTimer(0); // false
$timerBank->setTimer(0, new Timer(-1, 2, 30, [0, 1, 2, 3]));
$timerBank->hasTimer(0); // true
$timerBank->getTimer(0);

// 2021-03-01, 12:30:27
$display->setDateTime(2021, 3, 1, 12, 30, 27);

use Knevelina\Prolite\DisplayText;

$display->getPageBank()->setPage(0, sprintf('%sPoof!', DisplayText::DISPLAY_APPEAR));

use Knevelina\Prolite\DisplayText;

$display->getPageBank()->setPage(0, sprintf('%sThat is very bold of you.', DisplayText::format(false, false, true)));