Re: [Erlangweb-users] about wpart:fset
Brought to you by:
etcerlangweb,
paulgray
|
From: Michal P. <mic...@er...> - 2010-04-13 08:54:22
|
Hi,
----- "AndyChow" <diu...@16...> wrote:
> hi,
>
> when i set tpl variable tag in tpl file like this:
>
> <a wpart:href="/language/en/{reload_url}">English</a>
The wpart above will be expanded to
"/language/en/"reload_url""
In order to skip "" inside of the attributes values, use:
<a wpart:href="/language/en/{[string]reload_url}">English</a>
>
> And i add some code add my erl file, like this:
>
> show_item(Args) ->
> %% put the show_item function body here
> N = list_to_integer(proplists:get_value(id, Args)),
> Item = wtype_item:read(N),
> RUrl = wpart:fget("__path"),
> wpart:fset("item", wtype_item:format(Item)),
> wpart:fset("reload_url", RUrl),
> wpart_lang:get_translation("login_name"),
> {template, "item/show.html"}.
>
> when i recompile and restart service, i browse the app url, find tpl
> tag is replace like:
>
>
> <a href="/language/en/"item/show/15"">English</a>
> reload_url tag is replaced and some special characters not i wished..
>
>
> please give me a hand, thanks! :)
>
> _______________________________________________
> Erlangweb-users mailing list
> Erl...@li...
> https://lists.sourceforge.net/lists/listinfo/erlangweb-users
> http://www.erlang-web.org/
Best regards,
Michal Ptaszek
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
www.erlang-solutions.com
|