variables.baseurl = caller.baseurl;
in your custom tag (and the same for any similar errors) you should be
able to get it to work.
Sean
<cfset variables.baseurl = caller.baseurl> // throws exception:
Element BASEURL is undefined in CALLER.
<cfoutput>#buildURL("abc")#</cfoutput>
<!--- Then I cfdump caller and located baseurl in framework struct,
so I tried this --->
<cfset variables.framework = caller.framework>
<cfoutput>#buildURL("abc")#</cfoutput>
Variable GETFULLYQUALIFIEDACTION is undefined.
The error occurred in
C:\ColdFusion9Frameworks\org\corfield\framework.cfc: line 83
Called from C:\ColdFusion9\wwwroot\layouts\li.cfm: line 2
Called from C:\ColdFusion9\wwwroot\layouts\default.cfm: line 17
Called from C:\ColdFusion9Frameworks\org\corfield\framework.cfc: line 1411
Called from C:\ColdFusion9Frameworks\org\corfield\framework.cfc: line 518
81 : <cfset basePath = arguments.path & initialDelim & replace(
getFullyQualifiedAction( arguments.action ), '.', '/' ) />
82 : <cfelse>
83 : <cfset basePath = arguments.path & initialDelim &
variables.framework.action & equalDelim &
getFullyQualifiedAction(arguments.action) />
84 : </cfif>
Thanks,
Henry
> --
> FW/1 on RIAForge: http://fw1.riaforge.org/
>
> FW/1 on github: http://github.com/seancorfield/fw1
>
> FW/1 on Google Groups: http://groups.google.com/group/framework-one
<cfset structAppend(variables, caller)>
This is a little heavy handed, so you may want to scale back an entire
copying of the variables scope once you figure out what you need. :-)
The other possibility is to pass in what you need via attributes.
composition over inheritance, and no scope issue?
Just need to call fw.buildURL() instead of buildURL().. but how?
Henry
Well, the view *can* access variables.buildURL() or this.buildURL() -
the "fw" is THIS scope so what you might try is this on your custom
tag:
<cf_mytag fw=this> ... </cf_mytag>
and then attributes.fw.buildURL() might work inside the custom tag.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
Ooh, that is slick! And I should have thought of it since I'm using a
similar technique with ColdBox (where you have to alias a several
variables to make this sort of stuff work). Can't remember who
suggested it for ColdBox... probably Luis (so, thank you Luis, if it
was you!).