Sharing data with templates: cycle import error
This commit is contained in:
		@ -3,6 +3,7 @@ package render
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"go-udemy-web-1/pkg/config"
 | 
			
		||||
	"go-udemy-web-1/pkg/handlers"
 | 
			
		||||
	"html/template"
 | 
			
		||||
	"log"
 | 
			
		||||
	"net/http"
 | 
			
		||||
@ -17,7 +18,7 @@ func NewTemplates(a *config.AppConfig) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// RenderTemplate renders a HTML template file
 | 
			
		||||
func RenderTemplate(w http.ResponseWriter, tmpl string) {
 | 
			
		||||
func RenderTemplate(w http.ResponseWriter, tmpl string, td *handlers.TemplateData) {
 | 
			
		||||
	var tc map[string]*template.Template
 | 
			
		||||
	if app.UseCache {
 | 
			
		||||
		// get the template cache from the app config
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user