[session_var]

Description

Link: [session_var]
Author: Jason Huck
Category: Session
Version: 8.x
License:
Posted: Mar. 14, 2006
Updated: Jan. 01, 0001
More by this author...
Simultaneously defines variables and adds them to the given session.

Parameters

-name string, required The name of the session to which the variables should be added.

Sample Usage

session_start( -name='testsession');
session_result + '<br>\n';

session_var(
	-name='testsession',
	's_color' = 'red',
	's_size' = 5,
	's_date' = date
);

$s_color + ', ' + $s_color->type + '<br>\n';
$s_size + ', ' + $s_size->type + '<br>\n';
$s_date + ', ' + $s_date->type + '<br>\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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net