public function attr()
    {
        $args = func_get_args();

        $this->each(function ($item) use ($args) {
            if (count($args) >= 2) {
                $item->attr($args[0], $args[1]);
            } else {
                $item->attr($args[0]);
            }
        });

        return $this;
    }
public function attr()
    {
        $args = func_get_args();

        $this->each(function ($item) use ($args) {
            if (count($args) >= 2) {
                $item->attr($args[0], $args[1]);
            } else {
                $item->attr($args[0]);
            }
        });

        return $this;
    }
public function attr ( ) { $ args = func_get_args ( ) ; $ this -> each ( function ( $ item ) use ( $ args ) { if ( count ( $ args ) >= 2 ) { $ item -> attr ( $ args [ 0 ] , $ args [ 1 ] ) ; } else { $ item -> attr ( $ args [ 0 ] ) ; } } ) ; return $ this ; }
Add attributes to a collection of items.

@param  mixed

@return Collection
Add attributes to a collection of items .