Documentation

InDir

CSite::InDir(
 strIng Dir
) 

The method checks the location of directory. Static method.

Parameters

Parameter Description
DirSite directory

Examples of use

if(CSite::InDir('/about/')) {
// execution of condition for the /about/ directory and all its subdirectories, for example /about/contacts/
}

If only the /about section must be checked:

 if(CSite::InDir('/about/index.php')) { 
   // execute condition for the directory /about/, and specifically for the index.php page in the about directory
}


© «Bitrix24», 2001-2024
Up