private function get_file_extension( $view_root, $template_name ) {
		$paths = to_array( $this->get_path_to_views() );
		// get first element in array
		$path = reset( $paths );

		if ( ! empty( $view_root ) ) {
			$path .= '/' . $view_root;
		}

		$path .= '/' . $template_name;

		$files = glob( $path . '.*' );
		//return pathinfo of first $files element
		return pathinfo( reset( $files ), PATHINFO_EXTENSION );
	}
private function get_file_extension( $view_root, $template_name ) {
		$paths = to_array( $this->get_path_to_views() );
		// get first element in array
		$path = reset( $paths );

		if ( ! empty( $view_root ) ) {
			$path .= '/' . $view_root;
		}

		$path .= '/' . $template_name;

		$files = glob( $path . '.*' );
		//return pathinfo of first $files element
		return pathinfo( reset( $files ), PATHINFO_EXTENSION );
	}
private function get_file_extension ( $ view_root , $ template_name ) { $ paths = to_array ( $ this -> get_path_to_views ( ) ) ; // get first element in array $ path = reset ( $ paths ) ; if ( ! empty ( $ view_root ) ) { $ path .= '/' . $ view_root ; } $ path .= '/' . $ template_name ; $ files = glob ( $ path . '.*' ) ; //return pathinfo of first $files element return pathinfo ( reset ( $ files ) , PATHINFO_EXTENSION ) ; }
Find the first file extension that matches for this view template

@param  string $view_root
@param  string $template_name
@return mixed
Find the first file extension that matches for this view template