title: How can a I get a constant in smarty?
body: <p>I got a problem with Smarty and constants. I got three constant especified in a file:</p>
  
  <pre><code>DEFINE('ARTICLE_COLOUR_10', 'Light green');
  DEFINE('ARTICLE_COLOUR_11', 'Claret'); // Bordó
  DEFINE('ARTICLE_COLOUR_12', 'Yellow');
  </code></pre>
  
  <p>In DB I save only the numbers (10, 11, 12) and I send those numbers through this var</p>
  
  <pre><code>$sql_query_int = mysqli_query($connectdb, "SELECT colour FROM stock WHERE product='$articleId'");    
  $smarty-&gt;assign('colours', $sql_query_int);
  </code></pre>
  
  <p>In TPL I get those numbers</p>
  
  <pre><code>{foreach from=$colours key=field item=value}
      {$value.colour}&lt;br&gt;
  {/foreach}
  </code></pre>
  
  <p>Now I want to get the variable ARTICLE_COLOUR_$value.colour; I tried with three different ways but I couldn't get the complete variable.</p>
  
  <pre><code>{$smarty.const.ARTICLE_COLOUR_{$value.colour}}
  {$smarty.const.ARTICLE_COLOUR_$value.colour}
  {$smarty.const.ARTICLE_COLOUR_value.colour}
  </code></pre>
  
  <blockquote>
    <p>Fatal error: Smarty error: [in C:\xampp\htdocs/templates/default/tpl\article.tpl line 10]: syntax error: $smarty.$value.colour is an invalid reference (Smarty_Compiler.class.php, line 2169) in C:\xampp\htdocs\inc\smarty\Smarty.class.php on line 1109</p>
  </blockquote>
  
  <p>I will be grateful for your help with this problem and forgiveness if this question is misspelled, my English is not very advanced.</p>