Re: someVar to SOME_VAR

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Wednesday, February 11, 2009, 9:30:05 PM, Alex7 wrote:
>
> How to format string (variable name in camel-case) to look like constant?
>
> For example we have string "thisIsSomeVar" and transform it to
> "THIS_IS_SOME_VAR"
>
> Any ideas how to do it in Freemarker's templates?

No such buil-in exists... You have to write a custom method for that.
See TempateMethodModelEx in the API, or #function if you want to solve
it entirely in FTL.

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.