mixed CMain::GetFileRecursive( string file, mixed dir )
The method GetFileRecursive searches for a file recursively up the folder hierarchy.
Parameter | Description |
---|---|
file | Name of the file. |
dir | Path to the folder from which the search is to be performed. If set to false, the search will start from the current folder. Optional, false by default. |
Returns the path to the found file relative to the site root, or false otherwise.
<? // search for the file params.php up the folder hierarchy // starting from the current folder. // if the file can be found, include it include($_SERVER["DOCUMENT_ROOT"].$APPLICATION->GetFileRecursive("params.php")); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |