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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -