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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -