src/ActiveRecord.php
public function attributes()
    {
        $attributes = [];
        foreach ($this->rules() as $rule) {
            $names = reset($rule);
            if (is_string($names)) {
                $names = [$names];
            }
            foreach ($names as $name) {
                if (substr_compare($name, '!', 0, 1) === 0) {
                    $name = mb_substr($name, 1);
                }
                $attributes[$name] = $name;
            }
        }

        return array_values($attributes);
    }
public function attributes()
    {
        $attributes = [];
        foreach ($this->rules() as $rule) {
            $names = reset($rule);
            if (is_string($names)) {
                $names = [$names];
            }
            foreach ($names as $name) {
                if (substr_compare($name, '!', 0, 1) === 0) {
                    $name = mb_substr($name, 1);
                }
                $attributes[$name] = $name;
            }
        }

        return array_values($attributes);
    }
public function attributes ( ) { $ attributes = [ ] ; foreach ( $ this -> rules ( ) as $ rule ) { $ names = reset ( $ rule ) ; if ( is_string ( $ names ) ) { $ names = [ $ names ] ; } foreach ( $ names as $ name ) { if ( substr_compare ( $ name , '!' , 0 , 1 ) === 0 ) { $ name = mb_substr ( $ name , 1 ) ; } $ attributes [ $ name ] = $ name ; } } return array_values ( $ attributes ) ; }
Returns the list of attribute names.
By default, this method returns all attributes mentioned in rules.
You may override this method to change the default behavior.
@return string[] list of attribute names
Returns the list of attribute names . By default this method returns all attributes mentioned in rules . You may override this method to change the default behavior .