<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <link rel="stylesheet" href="assets/css/prism.css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <?php require '../vendor/autoload.php'; use CodeSnippet\Snippet; $snippet = new Snippet(); $lines = $snippet->file(__DIR__ . '/stubs/example.stub')->start(23)->length(8)->toString('<br />'); ?> <h1 class="text-center">CodeSnippet Example</h1> <h3 class="text-center">Snippet from file: <?php echo $snippet->getFilename(); ?> </h3> <div class="container"> <pre data-start="<?php echo $snippet->startsFrom(); ?> "><code class="language-js line-numbers"><?php echo $lines; ?>
<!-- Bootstrap CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <?php require '../vendor/autoload.php'; use CodeSnippet\Snippet; $snippet = new Snippet(); $lines = $snippet->file(__DIR__ . '/stubs/example.stub')->start(23)->length(8)->toArray(); ?> <h1 class="text-center">CodeSnippet Example</h1> <h3 class="text-center">Snippet from file: <?php echo $snippet->getFilename(); ?> </h3> <div class="container"> <pre><code><?php foreach ($lines as $line_number => $line) { $line = $line_number . '. ' . $line; if ($line_number == 28) { $line = '<span style="background:red; color: #fff;">' . $line . '</span>'; }