本文整理汇总了PHP中Parameter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Parameter::__construct方法的具体用法?PHP Parameter::__construct怎么用?PHP Parameter::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameter
的用法示例。
在下文中一共展示了Parameter::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* <ul>
* <li>By default the option is <i>OFF</i></li>
* <li>The output when option is <i>ON</i> is this parameter name</li>
* <li>The output when option is <i>OFF</i> is empty string</li>
* <li>The parameter is not required</li>
* </ul>
* @param string $name The parameter name, case insensitive
* @throws \MWException When $name not set
*/
public function __construct($name)
{
parent::__construct($name);
$this->default_value = false;
$this->output_on = $name;
$this->output_off = '';
}
示例2: __construct
/**
* <ul>
* <li>The default value is 0</li>
* <li>No minimal value</li>
* <li>No maximal value</li>
* <li>The parameter is not required</li>
* </ul>
* @param string $name The parameter name, case insensitive
* @throws \MWException When $name not set
*/
public function __construct($name)
{
parent::__construct($name);
$this->default_value = 0;
$this->min = null;
$this->max = null;
}
示例3: __construct
/**
* <ul>
* <li>The default value is the empty string</li>
* <li>HTML content is escaped for output.</li>
* <li>No validation of the content of the value</li>
* <li>Minimal length is 0 (accepts empty string)</li>
* <li>Maximal length is 1024</li>
* <li>The parameter is not required</li>
* </ul>
*
* @param string $name The parameter name, case insensitive
* @throws \MWException When $name not set
*/
public function __construct($name)
{
parent::__construct($name);
$this->escape_mode = 'html';
$this->validate_type = 'all';
// validates everything
$this->min_length = 0;
// accepts empty string
$this->max_length = 1024;
}
示例4: __construct
/**
* Constructor.
*
* @since 0.4
*
* @param string $name
* @param string $delimiter
* @param mixed $type
* @param mixed $default Use null for no default (which makes the parameter required)
* @param array $aliases
* @param array $criteria
*/
public function __construct($name, $delimiter = ListParameter::DEFAULT_DELIMITER, $type = Parameter::TYPE_STRING, $default = null, array $aliases = array(), array $criteria = array())
{
$itemCriteria = array();
$listCriteria = array();
$this->cleanCriteria($criteria);
foreach ($criteria as $criterion) {
if ($criterion->isForLists()) {
$listCriteria[] = $criterion;
} else {
$itemCriteria[] = $criterion;
}
}
$this->listCriteria = $listCriteria;
parent::__construct($name, $type, $default, $aliases, $itemCriteria);
$this->delimiter = $delimiter;
}
示例5:
/**
* @see ParameterTemplateParameterInterface::__construct()
* @param integer $parameter_id
*/
function __construct($parameter_id)
{
parent::__construct($parameter_id);
}
示例6: __construct
public function __construct(Parameter $parameter)
{
parent::__construct($parameter->getName(), $parameter->isRequired());
$this->parameter = $parameter;
}
示例7: __construct
/**
* <ul>
* <li>The default value is boolean <i>false</i></li>
* <li>The parameter is not required</li>
* </ul>
* @param string $name The parameter name, case insensitive
* @throws \MWException When $name not set
*/
public function __construct($name)
{
parent::__construct($name);
$this->default_value = false;
}
示例8: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct(array('required' => true, 'format' => true));
}
示例9: __construct
public function __construct($name, $class, $required = true)
{
parent::__construct($name, $required);
$this->class = $class;
}
示例10: __construct
/**
* This parameter is a container for several sub-parameters.
* Only one of these can be set by user (the XOR condition)
*
* Typical usage is for a "float" parameter, that contains options
* "right" and "left". See Vimeo widget for example.
*
* <ul>
* <li>The default value is the empty string</li>
* <li>No default sub-parameter</li>
* <li>The parameter is not required</li>
* </ul>
*
* @param string $name The parameter name, case insensitive
* @throws \MWException If $name not set
*/
public function __construct($name)
{
parent::__construct($name);
$this->parameters = array();
$this->default_parameter = null;
}