[client_getParam]

Description

Link: [client_getParam]
Author: Ke Carlton
Category: Client
Version: 8.x
License: Public Domain
Posted: Oct. 04, 2008
Updated: Jan. 01, 0001
More by this author...

This is a modified version of Jason's client_param tag. It has the same functionality but only works with client GET parameters.

Parameters

none


Sample Usage

// grab the param
client_getParam('test');

// count param count
client_getParam('test',-count);

// grab a specific instance of a param
client_getParam('test',1);
						

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
16
17
18
19
20
21
22
23
24
25
define_tag:  'getParam',
	-optional 	= 'key', 	-type = 'string',
	-optional     	= 'index',	-type = 'integer',
	-namespace 	= 'client_',
	-priority 	= 'replace',
	-description 	= 'Equivalent of [action_param], only for [client_getParams].';
				        
    if:local_defined('count');
        return(client_getParams->findPosition(#key)->size);
    else;		
	if:local_defined('index');
		protect;
			return: client_getParams->find(#key)->get(#index)->second;
		/protect;
	else;
		local('out') = array;
		iterate:client_getParams->find(#key),local('pair');
			#out->insert(#pair->isA('pair') ? #pair->second | null);
		/iterate;	
		return(#out->join('\r'));
	/if;
    /if;
    return:string;
/define_tag;

 

Comments

none

Email:


Password:



Newest

Most Popular