Skip to content

How do you create Pages and Views? #18

Answered by Splizard
SteveMaybe asked this question in Q&A
Discussion options

You must be logged in to vote

Pages

In Qlovaseed, pages are global views with special integration with the browser's navigation and paths.
To create a page, you need to implement the page interface:

type Page interface {
	Page(page.Router) seed.Seed
}

Here is an example, you should always return page.New from the Page method if possible.

//Create a type for the page, the type is used to globally identify the page.
type DemoPage struct {
	//Pages can take client-type arguments, defined as members of the page's struct type.
	Message client.String
}

func (demo DemoPage) Page(r page.Router) seed.Seed {
	return page.New(
		//The text is set to the value of the Message argument.
		text.New(text.SetStringTo(demo.Message)),
…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SteveMaybe
Comment options

@Splizard
Comment options

@SteveMaybe
Comment options

Answer selected by Splizard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants