php - Is there a way to change the format on how Yii2 creates ID's for fields within ActiveForm? -
i'm using activeform yii2 , default seems generate default id's fields if don't set one, in format of:
{action-name}-{field-name} so example if had field name of foo_bar used in action of actionsettings id of field generated as:
settings-foo_bar i prefer foo_bar.
is possible change on form form basis?
activefield id default created based on form's model name , field's name.
if want change whole form override the method it:
protected function getinputid() { return $this->_inputid ?: html::getinputid($this->model, $this->attribute); } and use modified class in form.
Comments
Post a Comment