Answer the question
In order to leave comments, you need to log in
How to add to the parent array in the element class, or overwrite the current element arrays?
for example in code:
class Parent {
public function rules()
{
return [
'bioString' => ['bio', 'string'],
'publicEmailPattern' => ['public_email', 'email'],
'gravatarEmailPattern' => ['gravatar_email', 'email'],
'websiteUrl' => ['website', 'url'],
'nameLength' => ['name', 'string', 'max' => 255],
'publicEmailLength' => ['public_email', 'string', 'max' => 255],
'gravatarEmailLength' => ['gravatar_email', 'string', 'max' => 255],
'locationLength' => ['location', 'string', 'max' => 255],
'websiteLength' => ['website', 'string', 'max' => 255],
'photoLength' => ['photo', 'string', 'max' => 200],
];
}
}
class Child extends Parent {
// вот тут в наследуемом элементе, нужно переписать один из элементов массива родителя либо дополнить другими элементами.
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question