Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Feature/view factory - #94

Open
joesteel2010 wants to merge 3 commits into
gernest:masterfrom
joesteel2010:feature/view-factory
Open

Feature/view factory#94
joesteel2010 wants to merge 3 commits into
gernest:masterfrom
joesteel2010:feature/view-factory

Conversation

@joesteel2010

@joesteel2010 joesteel2010 commented Jun 24, 2018

Copy link
Copy Markdown

I've added in a change to allow the default SimpleView implementation to be replaced by a custom View implementation.
Because all templates are parsed when NewMVC is called, there is no way to have templates that rely on other templates in the views directory. This change allows us to define supporting templates and add functions also.

Example usage:

utronView.SetViewFactory(func(viewDir string)(utronView.View, error){ return view.NewComplexView("fragments", viewDir, views.FuncMap) })

app, err := utron.NewMVC("config")

`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant