简体   繁体   中英

How to communicate between joomla components?

In my website a registered user navigates through various components, I am thinking of using session variable for all communications between components instead of a POST /GET. Is this a right thing to do?

I have several custom joomla 2.5 components written by me. Things like login welcome page, application1 and so on. Now the welcome page has buttons to these applications and instead of using a post/get I am thinking of using session variables. I am new to web technologies and I want to know pros and cons of this approach.

There's no need to use superglobals like $_SESSION when you're using a CMS like Joomla. Instead, use:

JRequest::setVar("varName");

and

JRequest::getVar("varName");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM