1283 Posts
Bucklash
6 years ago
2
Topic

Hi folks

Should it be possible to initiate a variable in beforeRender, and use it in AfterStore?

i.e. in beforeRender: $dave = 'Hey, Dave';

i.e. in AfterStore: do something with $dave...

Get a Book for SEBLOD
4229 Posts
Kadministrator
6 years ago
1
Level 1

You would need to push this value to the object that exist globaly, if not hign else you can use joomla application instance for that

1283 Posts
Bucklash
6 years ago
0
Level 2

Hi

This is the way:

BEFORERENDER:

$session = JFactory::getSession();
$session->set('food', 'cabbage');

BEFORESTORE/AFTERSTORE

$session = JFactory::getSession();
$eat = $session->get('food');

Get a Book for SEBLOD