Link | xs_url |
Author | Jonathan Guthrie |
Category | Data Type |
Version | 8.x |
License | Public Domain |
Posted | 01 Jun 2007 |
Updated | 01 Jun 2007 |
More by this author... |
Stores an array of url components, incorporates tags to add components, remove, or tuncate... and to return an assembled path.
local('urlis' = xs_url); #urlis->ops(-depth=integer(field('depth')),-component=(field('page_url'))); ''(field('name'))'';
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_type('url', 'array', -namespace = 'xs_', -prototype, -description = 'provides a type storing an array of url components, and incorporates tags to add components, remove, or tuncate... and to return an assembled path.'); define_tag('restart', -description='destroys/empties the thingie'); self->removeall; /define_tag; define_tag('reduce', -Required = 'by', -description = 'truncates x items from the tree'); loop(#by); self->removelast; /loop; /define_tag; define_tag('ops', -Required = 'depth', -Required = 'component', -description = 'compares and works out what to do with it...'); if(#depth == 0); self->restart; self->insert(#component); else(#depth > (self->size - 1)); self->insert(#component); else(#depth < (self->size - 1)); self->reduce(-by=(self->size - #depth)); self->insert(#component); else(#depth == (self->size - 1)); self->reduce(-by=1); self->insert(#component); /if; /define_tag; define_tag('assemble', -returnType = 'string', -description = 'returns an assembled path from root in the format of /hello/world/how/are/you/'); local('out' = '/'); iterate(self,local('temp')); #out += #temp; #out += '/'; /iterate; return(@#out); /define_tag; /define_type;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft