original_string: public function css($stylesheet) {
          global $CFG;
  
          if ($this->headdone) {
              throw new coding_exception('Cannot require a CSS file after &lt;head> has been printed.', $stylesheet);
          }
  
          if ($stylesheet instanceof moodle_url) {
              // ok
          } else if (strpos($stylesheet, '/') === 0) {
              $stylesheet = new moodle_url($stylesheet);
          } else {
              throw new coding_exception('Invalid stylesheet parameter.', $stylesheet);
          }
  
          $this->cssurls[$stylesheet->out()] = $stylesheet;
      }
code: public function css($stylesheet) {
          global $CFG;
  
          if ($this->headdone) {
              throw new coding_exception('Cannot require a CSS file after &lt;head> has been printed.', $stylesheet);
          }
  
          if ($stylesheet instanceof moodle_url) {
              // ok
          } else if (strpos($stylesheet, '/') === 0) {
              $stylesheet = new moodle_url($stylesheet);
          } else {
              throw new coding_exception('Invalid stylesheet parameter.', $stylesheet);
          }
  
          $this->cssurls[$stylesheet->out()] = $stylesheet;
      }
code_tokens: public function css ( $ stylesheet ) { global $ CFG ; if ( $ this -> headdone ) { throw new coding_exception ( 'Cannot require a CSS file after &lt;head> has been printed.' , $ stylesheet ) ; } if ( $ stylesheet instanceof moodle_url ) { // ok } else if ( strpos ( $ stylesheet , '/' ) === 0 ) { $ stylesheet = new moodle_url ( $ stylesheet ) ; } else { throw new coding_exception ( 'Invalid stylesheet parameter.' , $ stylesheet ) ; } $ this -> cssurls [ $ stylesheet -> out ( ) ] = $ stylesheet ; }
docstring: Ensure that the specified CSS file is linked to from this page.
  
  Because stylesheet links must go in the <head> part of the HTML, you must call
  this function before {@link get_head_code()} is called. That normally means before
  the call to print_header. If you call it when it is too late, an exception
  will be thrown.
  
  Even if a particular style sheet is requested more than once, it will only
  be linked to once.
  
  Please note use of this feature is strongly discouraged,
  it is suitable only for places where CSS is submitted directly by teachers.
  (Students must not be allowed to submit any external CSS because it may
  contain embedded javascript!). Example of correct use is mod/data.
  
  @param string $stylesheet The path to the .css file, relative to $CFG->wwwroot.
  For example:
  $PAGE->requires->css('mod/data/css.php?d='.$data->id);
docstring_tokens: Ensure that the specified CSS file is linked to from this page .