code() public static method

Generates inline code.
public static code ( string $code, array $htmlOptions = [] ) : string
$code string the code.
$htmlOptions array additional HTML attributes.
return string the generated code.
Exemplo n.º 1
0
</section>

<!-- Code
    ================================================== -->
<section id="code">

    <div class="page-header">
        <h1>Code</h1>
    </div>

    <h2>Inline</h2>

    <div class="bs-docs-example">
        For example, <?php 
echo TbHtml::code('&lt;section>');
?>
 should be wrapped as inline.
    </div>
    <pre class="prettyprint linenums">
For example, &lt;?php echo TbHtml::code('&lt;section>'); ?> should be wrapped as inline.</pre>

    <h2>Code block</h2>

    <div class="bs-docs-example">
        <?php 
echo TbHtml::codeBlock('&lt;p>Sample text here...&lt;/p>');
?>
    </div>
    <pre class="prettyprint linenums">
&lt;?php echo TbHtml::codeBlock('&lt;p>Sample text here...&lt;/p>'); ?></pre>
Exemplo n.º 2
0
 public function testCode()
 {
     $I = $this->codeGuy;
     $html = TbHtml::code('Source code');
     $code = $I->createNode($html, 'code');
     $I->seeNodeText($code, 'Source code');
 }