public static function attribute($name, $value) {
        if ($value instanceof moodle_url) {
            return ' ' . $name . '="' . $value->out() . '"';
        }

        // special case, we do not want these in output
        if ($value === null) {
            return '';
        }

        // no sloppy trimming here!
        return ' ' . $name . '="' . s($value) . '"';
    }
public static function attribute($name, $value) {
        if ($value instanceof moodle_url) {
            return ' ' . $name . '="' . $value->out() . '"';
        }

        // special case, we do not want these in output
        if ($value === null) {
            return '';
        }

        // no sloppy trimming here!
        return ' ' . $name . '="' . s($value) . '"';
    }
public static function attribute ( $ name , $ value ) { if ( $ value instanceof moodle_url ) { return ' ' . $ name . '="' . $ value -> out ( ) . '"' ; } // special case, we do not want these in output if ( $ value === null ) { return '' ; } // no sloppy trimming here! return ' ' . $ name . '="' . s ( $ value ) . '"' ; }
Outputs a HTML attribute and value

@param string $name The name of the attribute ('src', 'href', 'class' etc.)
@param string $value The value of the attribute. The value will be escaped with {@link s()}
@return string HTML fragment
Outputs a HTML attribute and value