public set_prefix ( string $prefix ) : object | ||
$prefix | string | |
return | object | $this |
public function set_prefix($prefix)
{
$escaped_prefix = preg_quote($this->name_prefix, '~');
$this->name = preg_replace('~^' . $escaped_prefix . '~', '', $this->name);
$this->name_prefix = $prefix;
$this->name = $this->name_prefix . $this->name;
return $this;
}
/** * Generate and set the field prefix. * @param string $prefix */ public function set_prefix($prefix) { parent::set_prefix($prefix); foreach ($this->groups as $group) { $group->set_prefix($prefix); } }