Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
86528c7b
Commit
86528c7b
authored
Aug 02, 2016
by
astaxie
Committed by
GitHub
Aug 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2030 from saturn4er/feature/add_template_prefix_field
Add template prefix field to controller
parents
ce6d6739
0943ef9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
controller.go
controller.go
+4
-0
No files found.
controller.go
View file @
86528c7b
...
...
@@ -71,6 +71,7 @@ type Controller struct {
TplName
string
Layout
string
LayoutSections
map
[
string
]
string
// the key is the section name and the value is the template name
TplPrefix
string
TplExt
string
EnableRender
bool
...
...
@@ -227,6 +228,9 @@ func (c *Controller) renderTemplate() (bytes.Buffer, error) {
if
c
.
TplName
==
""
{
c
.
TplName
=
strings
.
ToLower
(
c
.
controllerName
)
+
"/"
+
strings
.
ToLower
(
c
.
actionName
)
+
"."
+
c
.
TplExt
}
if
c
.
TplPrefix
!=
""
{
c
.
TplName
=
c
.
TplPrefix
+
c
.
TplName
}
if
BConfig
.
RunMode
==
DEV
{
buildFiles
:=
[]
string
{
c
.
TplName
}
if
c
.
Layout
!=
""
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment