Typo3 Extbase设置并从会话中获取值 [英] Typo3 Extbase Set and Get values from Session

查看:83
本文介绍了Typo3 Extbase设置并从会话中获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在typo3 v6.1上编写extbase扩展 该扩展名想进行公交车票预订. 这是我的计划,用户将选择座位的日期和数量并提交表格.

I am writing an extbase extension on typo3 v6.1 That extension suppose to do a bus ticket booking. Here what my plan is, user will select date and number of seats and submit the form.

在这里,我计划将所选席位的日期和费率推送至会话(购物篮). 在付款时,我想从会话中获取该值,在付款后,我需要清除该特定会话.

Here my plan to push the date and rate of the selected seat to session (Basket). And while making payment, I wanted to get that values from session and after payment I need to clear that particular session.

因此,简而言之,如何在extbase中的会话之间推入和检索值. 有什么建议 ? 谢谢.

So In short, How to Push and retrieve the values to and from the session in extbase. Any suggestions ? Thank you.

推荐答案

有不同的方法.最简单的方法是在会话中编写

There are different ways. The simplest would be for writing in the session

$GLOBALS['TSFE']->fe_user->setKey("ses","key",$value)

并用于从会话中读取值

$GLOBALS["TSFE"]->fe_user->getKey("ses","key")

这篇关于Typo3 Extbase设置并从会话中获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆