Link | var_define |
Author | Shelane French |
Category | Variable |
Version | 8.5.x |
License | Public Domain |
Posted | 11 Mar 2014 |
Updated | 11 Mar 2014 |
More by this author... |
Modified from the Lasso siteAdmin tags, this tag allows you to define a variable, assign it to a session, validate when setting from an action parameter, force a value, and set a default value.
var_define('route', -default=string, -override=action_param('route'), -validate=array('login', 'settings', 'session', 'interest', 'search')); var_define('legal', -override=action_param('legal'), -session='mysession');
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('define', -Namespace='var_', -required='name', -optional='default', -optional='session', -optional='override', -optional='force', -optional='validate', -type='array', -priority='replace'); if(local_defined('force')); var(#name = #force); else(local_defined('override') && #override != '' && local_defined('validate') && #validate->size); if(#validate >> #override); var(#name = #override); else(local_defined('default')); var(#name = #default); else; var(#name = ''); /if; else(local_defined('override') && #override != ''); var(#name = #override); else(local_defined('default') && var(#name) == '' && #default != ''); var(#name = #default); else(var_defined(#name) == false || var(#name) == null); var(#name = ''); /if; if(local_defined('session') && #session != ''); session_addvar(-name=#session, #name); /if; /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft