original_string: public static function get_template_filepath($name, $themename = '') {
          global $CFG, $PAGE;
  
          if (strpos($name, '/') === false) {
              throw new coding_exception('Templates names must be specified as "componentname/templatename"' .
                                         ' (' . s($name) . ' requested) ');
          }
          list($component, $templatename) = explode('/', $name, 2);
          $component = clean_param($component, PARAM_COMPONENT);
          if (strpos($templatename, '/') !== false) {
              throw new coding_exception('Templates cannot be placed in sub directories (' . s($name) . ' requested)');
          }
  
          $dirs = self::get_template_directories_for_component($component, $themename);
  
          foreach ($dirs as $dir) {
              $candidate = $dir . $templatename . '.mustache';
              if (file_exists($candidate)) {
                  return $candidate;
              }
          }
  
          throw new moodle_exception('filenotfound', 'error', '', null, $name);
      }
code: public static function get_template_filepath($name, $themename = '') {
          global $CFG, $PAGE;
  
          if (strpos($name, '/') === false) {
              throw new coding_exception('Templates names must be specified as "componentname/templatename"' .
                                         ' (' . s($name) . ' requested) ');
          }
          list($component, $templatename) = explode('/', $name, 2);
          $component = clean_param($component, PARAM_COMPONENT);
          if (strpos($templatename, '/') !== false) {
              throw new coding_exception('Templates cannot be placed in sub directories (' . s($name) . ' requested)');
          }
  
          $dirs = self::get_template_directories_for_component($component, $themename);
  
          foreach ($dirs as $dir) {
              $candidate = $dir . $templatename . '.mustache';
              if (file_exists($candidate)) {
                  return $candidate;
              }
          }
  
          throw new moodle_exception('filenotfound', 'error', '', null, $name);
      }
code_tokens: public static function get_template_filepath ( $ name , $ themename = '' ) { global $ CFG , $ PAGE ; if ( strpos ( $ name , '/' ) === false ) { throw new coding_exception ( 'Templates names must be specified as "componentname/templatename"' . ' (' . s ( $ name ) . ' requested) ' ) ; } list ( $ component , $ templatename ) = explode ( '/' , $ name , 2 ) ; $ component = clean_param ( $ component , PARAM_COMPONENT ) ; if ( strpos ( $ templatename , '/' ) !== false ) { throw new coding_exception ( 'Templates cannot be placed in sub directories (' . s ( $ name ) . ' requested)' ) ; } $ dirs = self :: get_template_directories_for_component ( $ component , $ themename ) ; foreach ( $ dirs as $ dir ) { $ candidate = $ dir . $ templatename . '.mustache' ; if ( file_exists ( $ candidate ) ) { return $ candidate ; } } throw new moodle_exception ( 'filenotfound' , 'error' , '' , null , $ name ) ; }
docstring: Helper function for getting a filename for a template from the template name.
  
  @param string $name - This is the componentname/templatename combined.
  @param string $themename - This is the current theme name.
  @return string
docstring_tokens: Helper function for getting a filename for a template from the template name .