src/Code/Code.php
protected function getVars($content, $details = [])
    {
        // Build defaults
        $defaults = [
            'id' => '',
            'title' => Translate::t('code.title', [], 'codefield'),
            'description' => '',
            'change' => true,
            'readonly' => false,
            'rows' => 4,
            'modes' => $this->getCodeModes(),
            'default' => [
                'mode' => 'application/json',
                'code' => ''
            ],
        ];

        // Build defaults data
        $vars = array_merge($defaults, $content);
        $vars['default']['mode'] = $this->retrieveMode($vars['default']['mode']);

        // Retrieve field value
        $vars['val'] = $this->getValue($content['id'], $details, $vars['default']);

        // Update vars
        $this->getModel()->setVars($vars);
    }
protected function getVars($content, $details = [])
    {
        // Build defaults
        $defaults = [
            'id' => '',
            'title' => Translate::t('code.title', [], 'codefield'),
            'description' => '',
            'change' => true,
            'readonly' => false,
            'rows' => 4,
            'modes' => $this->getCodeModes(),
            'default' => [
                'mode' => 'application/json',
                'code' => ''
            ],
        ];

        // Build defaults data
        $vars = array_merge($defaults, $content);
        $vars['default']['mode'] = $this->retrieveMode($vars['default']['mode']);

        // Retrieve field value
        $vars['val'] = $this->getValue($content['id'], $details, $vars['default']);

        // Update vars
        $this->getModel()->setVars($vars);
    }
Prepare HTML component.

@param array $content
@param array $details