Lasso Soft Inc. > Home

[client_getParam]

Linkclient_getParam
AuthorKe Carlton
CategoryClient
Version8.x
LicensePublic Domain
Posted04 Oct 2008
Updated04 Oct 2008
More by this author...

Description

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

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.

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;

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