pongo

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 6 Imported by: 0

README

gFly View - Pongo engine

Usage

Install

go get -u github.com/gflydev/view/pongo@v1.0.2

Quick usage main.go

import (
    "github.com/gflydev/core"
    "github.com/gflydev/view/pongo"	
)

// Register view
core.RegisterView(pongo.New())
Page & View
// =========================================================================================
//                                     About page
// =========================================================================================

// NewAboutPage As a constructor to create a About Page.
func NewHomePage() *AboutPage {
    return &AboutPage{}
}

type AboutPage struct {
    core.Page
}

func (m *AboutPage) Handle(c *core.Ctx) error {
    return c.View("about", core.Data{
        "title": "About Us",
    })
}

Template file resources/views/about.tpl

<center><h2>{{ title }}</h2></center>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() core.IView

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL