Skip to content

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

Merged
merged 4 commits into from
Jun 6, 2017

Conversation

notzippy
Copy link
Collaborator

@notzippy notzippy commented May 4, 2017

Adds template engine support

)

type TemplateEngine interface {
// #ParseAndAdd: prase template string and add template to the set.
Copy link
Member

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
Copy link
Member

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

// 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 {
Copy link
Member

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?

@notzippy notzippy force-pushed the server-templates branch 3 times, most recently from f92f97d to adf488a Compare May 25, 2017 00:30
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handles()

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEMPLATE_REFRESH_COMPLETED?

notzippy added 4 commits June 6, 2017 10:21
Deprecated TemplateLoader.Template - Replaced with TemplateLoader.TemplateLang (old function still exists for backwards compatibility)
Renamed TemplateEngine interface "IsEngineFor" to "Handles"
@notzippy notzippy force-pushed the server-templates branch from 730a190 to 6dd3fbf Compare June 6, 2017 17:21
@notzippy notzippy merged commit a8dd97a into revel:develop Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy