I was trying to do this today and it didn’t work?
Event.BuildLink(‘/space/:uniqueUrl/moduleName/handler/action’)
Could this be supported or is it already an I am doing something wrong?
Regards,
Andrew Scott
I was trying to do this today and it didn’t work?
Event.BuildLink(‘/space/:uniqueUrl/moduleName/handler/action’)
Could this be supported or is it already an I am doing something wrong?
Regards,
Andrew Scott
What are you expecting this to do?
Luis F. Majano
President
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com
I am expecting that it do this
If I have a route that is defined like this
/space/:uniqueUrl/module/
Then I should be able to do this
buildLink(‘/space/:uniqueUrl/module/doHandler’);
I don’t see this being a problem because the information has already been captured by CB.
Regards,
Andrew Scott
What would be the outoput of such a call?
Luis F. Majano
President
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com
What do you mean the output? It would build the URL based on what it knows, Luis I think this is self-explanatory.
Regards,
Andrew Scott
How would it know what uniqeurl is?
The way paths are set up are like this: /:handler/:event/ This route
says that when you make a specific request to
http://foo.biz/index.cfm/users/show it will know that users should be
mapped to the handler variable and that show should be mapped to the
event variable. So all a route knows about is how to parse an incoming
http request.
BuildLink is a convenience method that is set up to take care of all
the other gunk for you other than specifying handler and event. If you
say BuildLInk('user/show') it will look at the way your app is set up
and say, oh, I need to create an output that is
http://foo.biz/index.cfm/users/show
BuildLink doesn't have any knowledge of what event you are currently
in and it shouldn't. Image that you have a nav menu on your site. You
have three links, to show a listing of users, groups and resources.
They might be set up with BuildLink('users/show'),
BuildLInk('groups/show') and BuildLink('resources/show'). These links
are going to stay the same no matter where on the site you are,
doesn't matter if you are currently looking at users, groups or
resources.
If you are trying to build links that are based on the current event,
you should be able to get the name of the current event that is
executing and the method that is being run on it. I believe it is
gethandler() and getmethod() respectively. Using those you could build
up the links you want. Is that the sort of thing you are trying to do?
Judah
The variable is defined in the route, which is now in the RC very simple
logic is it not?
Judah you might need to rethink your statement, about the events etc I
couldn't care less about what event it is. I care about the fact that I have
a route defined with variables that are ending up in the RC, from here I
want to rebuild the link to go to a URL that is defined in my modules.
Currently, my routes make the BuildLink redundant because I can't use it.
Unless the BuildLink() can take :uniqueURl from the RC and reconstruct it
for me.
Does that make more sense now?
Regards,
Andrew Scott
http://www.andyscott.id.au/
From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Judah McAuley
Sent: Sunday, 10 October 2010 2:55 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:6155] Can BuildLink use route variables to rebuild
the
event?
How would it know what uniqeurl is?
The way paths are set up are like this: /:handler/:event/ This route
says that when you make a specific request to
http://foo.biz/index.cfm/users/show it will know that users should be
mapped to the handler variable and that show should be mapped to the
event variable. So all a route knows about is how to parse an incoming
http
request.
BuildLink is a convenience method that is set up to take care of all the
other
gunk for you other than specifying handler and event. If you say
BuildLInk('user/show') it will look at the way your app is set up and say,
oh, I
need to create an output that is http://foo.biz/index.cfm/users/show
BuildLink doesn't have any knowledge of what event you are currently in
and
it shouldn't. Image that you have a nav menu on your site. You have three
links, to show a listing of users, groups and resources.
They might be set up with BuildLink('users/show'),
BuildLInk('groups/show') and BuildLink('resources/show'). These links are
going to stay the same no matter where on the site you are, doesn't matter
if
you are currently looking at users, groups or resources.
If you are trying to build links that are based on the current event, you
should
Actually, it comes off as rather rude to me. I'm trying to be helpful
here and spent quite a bit of time explaining how BuildLink works and
trying to get at what exactly you are looking for.
Now I think I do understand what you are looking for and it is similar
to what I was already suggesting, which is that you simply grab the
item our of RC (though my previous email looked explicitly at
gethandler and method and you are looking for something generic).
BuildLink doesn't support the syntax you are looking for. The
equivalent would be
BuildLink('/space/#event.getValue("uniqueUrl")#/moduleName') The call
to get the value out of RC isn't as elegant as the syntax that defines
the routes but should work for your situation.
Cheers,
Judah
Yeah I know it doesn't which is why I am asking if it could, aka making a
suggestion to modify the buildLink to be able to handle it.
Regards,
Andrew Scott
http://www.andyscott.id.au/
From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Judah McAuley
Sent: Sunday, 10 October 2010 3:28 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:6161] Can BuildLink use route variables to rebuild
the
event?
Actually, it comes off as rather rude to me. I'm trying to be helpful here
and
spent quite a bit of time explaining how BuildLink works and trying to get
at
what exactly you are looking for.
Now I think I do understand what you are looking for and it is similar to
what I
was already suggesting, which is that you simply grab the item our of RC
(though my previous email looked explicitly at gethandler and method and
you are looking for something generic).
BuildLink doesn't support the syntax you are looking for. The equivalent
would be
BuildLink('/space/#event.getValue("uniqueUrl")#/moduleName') The call to
get the value out of RC isn't as elegant as the syntax that defines the
routes