TbHtml::code PHP Method

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.
    public static function code($code, $htmlOptions = array())
    {
        return self::tag('code', $htmlOptions, self::encode($code));
    }

Usage Example

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>
All Usage Examples Of TbHtml::code
TbHtml