Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html name attribute #365

Closed
un7known opened this issue Oct 26, 2021 · 2 comments
Closed

Html name attribute #365

un7known opened this issue Oct 26, 2021 · 2 comments

Comments

@un7known
Copy link

un7known commented Oct 26, 2021

Как можно вручную задать атрибут name в html колонки?
Я хочу получить EmployeeWork[33][employeesParams][0][employee_id] вместо EmployeeWork[employeesParams][0][employee_id]
nameSuffix не решает мою проблему.

@unclead
Copy link
Owner

unclead commented Oct 26, 2021

я вижу тут 2 пути решения:

  • не завязываться на сам виджет и разрулить все на стороне контроллера.
  • можно использовать опцию columnClass через которую можно указать свой класс, унаследованный от базового. В своем классе надо переопределить метод getElementName

@un7known
Copy link
Author

Спасибо, я решил так

use unclead\multipleinput\MultipleInputColumn;

class MyMultipleInputColumn extends MultipleInputColumn
{

    public $namePrefix;
    protected function getInputNamePrefix()
    {
        if (isset($this->namePrefix)) {
            return $this->namePrefix;
        }
        return parent::getInputNamePrefix();
    }

}

@unclead unclead closed this as completed Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants