protected __construct ( string $name, string $label ) | ||
$name | string | Field name |
$label | string | Field label |
protected function __construct($name, $label)
{
$this->set_name($name);
$this->set_label($label);
$this->set_base_name($name);
// Pick random ID
$random_string = md5(mt_rand() . $this->get_name() . $this->get_label());
$random_string = substr($random_string, 0, 5);
// 5 chars should be enough
$this->id = 'carbon-' . $random_string;
$this->init();
}