本文整理汇总了PHP中FormElement::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP FormElement::__construct方法的具体用法?PHP FormElement::__construct怎么用?PHP FormElement::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormElement
的用法示例。
在下文中一共展示了FormElement::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param string $name
*/
public function __construct($name, $value = 0)
{
parent::__construct($name);
$this->count = MATCHMAKING_BOL_Service::MAX_COEFFICIENT;
$this->setValue($value);
$this->addValidator(new CoefficientValidator());
}
示例2: __construct
public function __construct($atts = null) {
parent::__construct($atts);
// Some defaults
$this->_attributes['class'] = 'formelement formcheckboxinput';
$this->_validattributes = array('accesskey', 'checked', 'dir', 'disabled', 'id', 'lang', 'name', 'required', 'tabindex', 'style', 'value');
}
示例3: __construct
public function __construct($atts = null) {
parent::__construct($atts);
// Some defaults
$this->_attributes['class'] = 'formelement formtextareainput';
$this->_validattributes = array('accesskey', 'dir', 'disabled', 'id', 'lang', 'name', 'placeholder', 'readonly', 'required', 'tabindex', 'rows', 'cols', 'style', 'class');
}
示例4: __construct
public function __construct($atts = null)
{
// Some defaults
$this->_attributes = array('class' => 'formelement multifileinput', 'previewdimensions' => '200x100', 'browsable' => false, 'basedir' => '');
$this->_validattributes = array();
$this->requiresupload = true;
parent::__construct($atts);
}
示例5: __construct
public function __construct($name)
{
parent::__construct($name);
$tagFieldName = 'input_' . $this->getName() . '_tag_field';
$this->tag = new TagsInputField($tagFieldName);
$this->tag->setMinChars(1);
$this->value = array();
}
示例6: __construct
public function __construct($atts = null)
{
parent::__construct($atts);
// Some defaults
$this->_attributes['class'] = 'formelement formwysiwyginput tinymce';
$this->_attributes['rows'] = '25';
// Note, I'm taking the required flag out from here; tinymce doesn't support it.
$this->_validattributes = array('accesskey', 'dir', 'disabled', 'id', 'lang', 'name', 'readonly', 'tabindex', 'rows', 'cols', 'style', 'class');
}
示例7: __construct
public function __construct($atts = null)
{
parent::__construct($atts);
// Some defaults
$this->_attributes['class'] = 'formelement formcaptchainput';
if (!$this->get('name')) {
$this->set('name', 'captcha');
}
$this->_validattributes = array('id', 'name', 'required', 'tabindex', 'style');
}
示例8: __construct
/**
* Constructor.
*
* @param string $name
*/
public function __construct($name, $invitation = null, $context = MCOMPOSE_BOL_Service::CONTEXT_USER)
{
parent::__construct($name);
if (!empty($invitation)) {
$this->setInvitation($invitation);
}
$this->context = $context;
$this->addClass('mc-user-select');
$this->addClass('jhtmlarea');
$this->service = MCOMPOSE_BOL_Service::getInstance();
}
示例9: __construct
public function __construct($atts = null)
{
$defaults = ['class' => 'formelement geoaddressforminput', 'use_label' => true];
parent::__construct($atts);
// Some defaults
foreach ($defaults as $k => $v) {
if (!isset($this->_attributes[$k])) {
$this->_attributes[$k] = $v;
}
}
}
示例10: __construct
public function __construct($atts = null) {
parent::__construct($atts);
// Some defaults
$defaults = [
'class' => 'formelement formbuttoninput',
];
foreach($defaults as $k => $v){
if(!isset($this->_attributes[$k])){
$this->_attributes[$k] = $v;
}
}
$this->_validattributes = array('accesskey', 'dir', 'disabled', 'id', 'lang', 'name', 'size', 'tabindex', 'width', 'height', 'value', 'style');
}
示例11: __construct
public function __construct($atts = null){
parent::__construct($atts);
// Some defaults
$defaults = [
'class' => 'formelement formuserinput',
];
foreach($defaults as $k => $v){
if(!isset($this->_attributes[$k])){
$this->_attributes[$k] = $v;
}
}
$this->_validattributes = array(
'accesskey', 'autocomplete', 'dir', 'disabled',
'lang', 'maxlength', 'placeholder',
'required', 'size', 'tabindex', 'width', 'height',
'style'
);
}
示例12: foreach
/**
* Constructor
*
* @param string $name
* @param string $selectedValue
* @param Option $optionsTags
* @param string or array $options
* @author Justin Palmer
*/
function __construct($name, $selectedValue, $optionTags, $options = null)
{
$args = func_get_args();
$name = array_shift($args);
$selectedValue = array_shift($args);
$options = array_pop($args);
$options = $this->preparePrompt($options);
if ($args[0] !== null) {
foreach ($args as $option) {
if (!$option instanceof Option) {
throw new Exception("Invalid tag for element 'Select'. Only 'Option' elements may be passed.");
}
if ($option->value === $selectedValue) {
$option->selected = true;
}
$this->display .= $option . "\n";
}
}
parent::__construct($name, '', $options);
}
示例13: __construct
public function __construct($atts = null) {
parent::__construct($atts);
// Some defaults
$this->_attributes['class'] = 'formelement formtextinput';
$this->_validattributes = [
'accesskey', 'autocomplete',
'dir', 'disabled',
'height',
'id',
'lang',
'maxlength',
'name',
'placeholder',
'readonly',
'required',
'size',
'style',
'tabindex',
'value',
'width',
];
}
示例14: __construct
/**
* Constructor
*
* @param string $name Database column name
* @param string $label Label content
* @param array $options Array containing values available for selection
*/
public function __construct($name, $label, $options = array())
{
parent::__construct($name);
$this->setLabel($label);
$this->setOptions($options);
}
示例15:
function __construct($initial_value = '', $name = null)
{
parent::__construct('select', $initial_value, $name, true);
}