PHP code example of jeroendn / php-js-console-logger

1. Go to this page and download the library: Download jeroendn/php-js-console-logger 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/ */

    

jeroendn / php-js-console-logger example snippets


use jeroendn\PhpJsConsoleLogger\PhpJsConsoleLogger;

$logger = new PhpJsConsoleLogger();

/**
 * Setting tting optional parameters
 */
$logger
  ->setTimeout(5000)
  ->setInterval(500)
  ->setIterations(5)
  ->setIterationSpacer('-')

echo $logger->getHtml(); // Returns the generated JavaScript inside an HTML tag
// OR
echo $logger->getJs(): // Returns the generated JavaScript
shell
docker exec -it php_php_js_console_logger ./vendor/bin/phpunit