Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Add a view template in the location [customization_folder]/views/question_customtype/tmpl/default.php

Important: Every question template needs to have the <div> wrapper with the attributes below.

Code Block
languagephp
<?php
defined('CB_VALID_ENTRY') or die();
/** @var $this ConfigboxViewQuestion_Customtype */
?>
<div id="<?php echo hsc($this->questionCssId);?>" class="<?php echo hsc($this->questionCssClasses);?>" <?php echo $this->questionDataAttributes;?>>

</div>

Within the template and this wrapper, you add HTML and question data as needed. You can compare the template with the ones of the built-in question types in [application_dir]/views/question_*

Security

Use the function hsc() to escape variable output. It is a shortcut to html_special_charshtmlspecialchars($string, ENT_QUOTES).

Notable view variables

...