Lasso Soft Inc. > Home

[session_var]

Linksession_var
AuthorJason Huck
CategorySession
Version8.x
Licensehttp://opensource.org/licenses/artistic-license.php
Posted14 Mar 2006
Updated14 Mar 2006
More by this author...

Description

Simultaneously defines variables and adds them to the given session.

Sample Usage

session_start( -name='testsession');
session_result + '
\n'; session_var( -name='testsession', 's_color' = 'red', 's_size' = 5, 's_date' = date ); $s_color + ', ' + $s_color->type + '
\n'; $s_size + ', ' + $s_size->type + '
\n'; $s_date + ', ' + $s_date->type + '
\n';

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag(
	'var',
	-namespace='session_',
	-required='name',
	-priority='replace',
	-description='Simultaneously defines variables and adds them to the given session.'
);	
	iterate(params, local('i'));
		if(!#i->first->waskeyword);
			!var_defined(#i->first) ? var(#i->first) = #i->second;
			session_addvar( -name=#name, #i->first);
		/if;
	/iterate;
/define_tag;

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft