<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.componere-definition.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'componere-definition.addconstant.php',
    1 => 'Componere\\Definition::addConstant',
    2 => 'Add Constant',
  ),
  'up' => 
  array (
    0 => 'class.componere-definition.php',
    1 => 'Componere\\Definition',
  ),
  'prev' => 
  array (
    0 => 'componere-definition.construct.php',
    1 => 'Componere\\Definition::__construct',
  ),
  'next' => 
  array (
    0 => 'componere-definition.addproperty.php',
    1 => 'Componere\\Definition::addProperty',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/componere/componere/definition/addconstant.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="componere-definition.addconstant" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Componere\Definition::addConstant</h1>
  <p class="verinfo">(Componere 2 &gt;= 2.1.0)</p><p class="refpurpose"><span class="refname">Componere\Definition::addConstant</span> &mdash; <span class="dc-title">Add Constant</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-componere-definition.addconstant-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Componere\Definition::addConstant</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="class.componere-value.php" class="type Componere\Value">Componere\Value</a></span> <code class="parameter">$value</code></span>): <span class="type">Definition</span></div>

  <p class="simpara">
   Shall declare a class constant on the current Definition
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-componere-definition.addconstant-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">name</code></dt>
    <dd>
     <span class="simpara">
      The case sensitive name for the constant
     </span>
    </dd>
   
   
    <dt><code class="parameter">value</code></dt>
    <dd>
     <span class="simpara">
      The Value for the constant, must not be undefined or static
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-componere-definition.addconstant-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   The current Definition
  </p>
 </div>


 <div class="refsect1 exceptions" id="refsect1-componere-definition.addconstant-exceptions">
  <h3 class="title">Exceptions</h3>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="simpara">
    Shall throw <span class="type"><a href="class.runtimeexception.php" class="type RuntimeException">RuntimeException</a></span> if <span class="type">Definition</span> was registered
   </p>
  </div>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="simpara">
    Shall throw <span class="type"><a href="class.runtimeexception.php" class="type RuntimeException">RuntimeException</a></span> if <code class="parameter">name</code> is already declared as a constant
   </p>
  </div>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="simpara">
    Shall throw <span class="type"><a href="class.runtimeexception.php" class="type RuntimeException">RuntimeException</a></span> if <code class="parameter">value</code> is static
   </p>
  </div>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="simpara">
    Shall throw <span class="type"><a href="class.runtimeexception.php" class="type RuntimeException">RuntimeException</a></span> if <code class="parameter">value</code> is undefined
   </p>
  </div>
 </div>


</div><?php manual_footer($setup); ?>