Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f267ee8a
authored
2014-09-23 00:26:07 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix the same name controller for UrlFor
1 parent
7e060e6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
router.go
router.go
View file @
f267ee8
...
...
@@ -415,7 +415,7 @@ func (p *ControllerRegistor) UrlFor(endpoint string, values ...string) string {
}
}
}
controllName
:=
strings
.
Join
(
paths
[
:
len
(
paths
)
-
1
],
"
.
"
)
controllName
:=
strings
.
Join
(
paths
[
:
len
(
paths
)
-
1
],
"
/
"
)
methodName
:=
paths
[
len
(
paths
)
-
1
]
for
_
,
t
:=
range
p
.
routers
{
ok
,
url
:=
p
.
geturl
(
t
,
"/"
,
controllName
,
methodName
,
params
)
...
...
@@ -443,7 +443,8 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
}
for
_
,
l
:=
range
t
.
leaves
{
if
c
,
ok
:=
l
.
runObject
.
(
*
controllerInfo
);
ok
{
if
c
.
routerType
==
routerTypeBeego
&&
c
.
controllerType
.
Name
()
==
controllName
{
if
c
.
routerType
==
routerTypeBeego
&&
strings
.
HasSuffix
(
path
.
Join
(
c
.
controllerType
.
PkgPath
(),
c
.
controllerType
.
Name
()),
controllName
)
{
find
:=
false
if
_
,
ok
:=
HTTPMETHOD
[
strings
.
ToUpper
(
methodName
)];
ok
{
if
len
(
c
.
methods
)
==
0
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment