ajax and "variable" session variable in view

44 views
Skip to first unread message

v.

unread,
Sep 6, 2018, 9:03:18 AM9/6/18
to Fat-Free Framework
I am writing an application that relies heavily on ajax calls.
I have a template with an input field which is used in many pages for different variables:
<input name="{{ @id }}" type="text">

Now I need to be able to insert the corresponding session value if this already exists, eg if the name of the input box is "widget", the corresponding session variable will be "@SESSION.widget".

I tried:
{{ @SESSION.@id }}
and
{{ @SESSION.{{@id}} }}
but they return a 500 error.
Is it possible to do this or do I need to circumvent this problem by introducing a new variable.

Richard Goldstein

unread,
Sep 6, 2018, 9:13:00 AM9/6/18
to v. via Fat-Free Framework, Fat-Free Framework
{{ @SESSION.id }} should work if id is set in session.
--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To post to this group, send email to f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/039d75a0-efdc-417f-9a26-6934a6ad2d93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Rich Goldstein, MD

ved

unread,
Sep 6, 2018, 9:28:57 AM9/6/18
to Fat-Free Framework
Try {{ @SESSION[@id] }}

v.

unread,
Sep 6, 2018, 11:53:27 AM9/6/18
to Fat-Free Framework
On Thursday, September 6, 2018 at 3:28:57 PM UTC+2, ved wrote:
Try {{ @SESSION[@id] }}

works like a charm! Thanks!

Reply all
Reply to author
Forward
0 new messages