PHP code example of stoffel / console-sourcecode
1. Go to this page and download the library: Download stoffel/console-sourcecode 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/ */
stoffel / console-sourcecode example snippets
use Stoffel\Console\SourceCode\SourceCodeHelper;
// print code from variable
SourceCodeHelper::create($output)
->write($code);
// print code from file
SourceCodeHelper::create($output)
->writeFile('/path/to/source-file.php');
// print only an excerpt
SourceCodeHelper::create($output)
->writeFile('/path/to/source-file.php', 59, 17);
// chose one of the predefined themes
SourceCodeHelper::create($output)
->useTheme('seti')
->writeFile('/path/to/source-file.php');
// disable line numbers
SourceCodeHelper::create($output)
->disableLineNumbers()
->writeFile('/path/to/source-file.php');