PHP code example of interaction-design-foundation / nova-html-code-field

1. Go to this page and download the library: Download interaction-design-foundation/nova-html-code-field 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/ */

    

interaction-design-foundation / nova-html-code-field example snippets


use InteractionDesignFoundation\NovaHtmlCodeField\HtmlCode;

public function fields()
{
    return [
        HtmlCode::make('HTML content', 'content'),
     ];
}

HtmlCode::make('HTML content', 'content')
    ->styles([asset(mix('css/app.css'))]), // optional, you can inject your custom CSS files to have more realistic preview.
    ->previewTemplate('<section class="panel">%CODE%</section>') // optional, wrap editable code to have even better preview (good together with custom styles).