-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Changes to revel to support a template engine architecture #1170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
02f0f5e
to
0e865cc
Compare
template_engine.go
Outdated
) | ||
|
||
type TemplateEngine interface { | ||
// #ParseAndAdd: prase template string and add template to the set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove #
since they do nothing in godoc output
template.go
Outdated
Content() []string // Content | ||
// #Render: Called by the server to render the template out the io.Writer, args contains the arguements to be passed to the template. | ||
// arg: wr io.Writer | ||
// arg: arg interface{} | ||
Render(wr io.Writer, arg interface{}) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arg
to context
or args
template_adapter_go.go
Outdated
// The functions available for use in the templates. | ||
TemplateFuncs = map[string]interface{}{ | ||
"url": ReverseURL, | ||
"set": func(renderArgs map[string]interface{}, key string, value interface{}) template.JS { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewArgs
or context
or contextArgs
?
f92f97d
to
adf488a
Compare
template_engine.go
Outdated
Event(event int, arg interface{}) | ||
|
||
// returns true if this engine should be used to parse the file specified in baseTemplate | ||
IsEngineFor(engine TemplateEngine, templateView *TemplateView) bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handles()
5bb78e2
to
0ad63f9
Compare
revel.go
Outdated
) | ||
|
||
const ( | ||
// RevelImportPath Revel framework import path | ||
RevelImportPath = "github.com/revel/revel" | ||
) | ||
const ( | ||
// Called when templates are going to be refreshed (receivers are registered template engines added to the template.engine conf option) | ||
TEMPLATE_REFRESH = iota |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEMPLATE_REFRESH_REQUESTED
?
revel.go
Outdated
// Called when templates are going to be refreshed (receivers are registered template engines added to the template.engine conf option) | ||
TEMPLATE_REFRESH = iota | ||
// Called when templates are refreshed (receivers are registered template engines added to the template.engine conf option) | ||
TEMPLATE_REFRESH_COMPLETE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEMPLATE_REFRESH_COMPLETED
?
Deprecated TemplateLoader.Template - Replaced with TemplateLoader.TemplateLang (old function still exists for backwards compatibility) Renamed TemplateEngine interface "IsEngineFor" to "Handles"
730a190
to
6dd3fbf
Compare
Adds template engine support