Link | include_once |
Author | Jason Huck |
Category | Include |
Version | 8.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 26 Oct 2005 |
Updated | 16 Jan 2006 |
More by this author... |
Includes the specified file only if it has not already been included using this tag. Based on this discussion from Lasso Talk.
Requires [file_pathfromroot], available here.
include_once('/path/to/file.inc');
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( 'once', -namespace='include_', -priority='replace', -description='Includes the specified file only if it has not already been included.' ); fail_if( !params->size || !params->first->isa('string'), -1, '[include_once] requires a file path as a parameter.' ); local('path') = file_pathfromroot(params->first); !var_defined('included_files') ? var('included_files' = set); if($included_files !>> #path); $included_files->insert(#path); return(include(#path)); /if; /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft