Files
quark-go/pkg/builder/actions/link.go
tangtanglove 5244508c40 first commit
2023-01-18 13:40:07 +08:00

36 lines
567 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package actions
import "github.com/quarkcms/quark-go/pkg/builder"
type Link struct {
Action
Href string `json:"href"`
Target string `json:"target"`
}
// 初始化
func (p *Link) ParentInit() interface{} {
p.ActionType = "link"
p.Target = "_self"
return p
}
/**
* 获取跳转链接
*
* @return string
*/
func (p *Link) GetHref(request *builder.Request) string {
return p.Href
}
/**
* 相当于 a 链接的 target 属性href 存在时生效
*
* @return string
*/
func (p *Link) GetTarget(request *builder.Request) string {
return p.Target
}