Bitrix Site Manager

CComponentEngine::MakeComponentUrlTemplates

array
MakeComponentUrlTemplates(
 array arDefaultUrlTemplates,
 array arCustomUrlTemplates
);

The method is used with human-friendly URL's in compound components. The method takes default path templates and component path templates, and replaces default path templates with those overridden in the component input parameters.

Parameters

Parameter Description
arDefaultUrlTemplates An array of default path templates.
arCustomUrlTemplates An array of path templates passed in the input parameters on the component.

Return Values

An array of path templates.

Example


// if an array of the default path templates has 
// the following format: $arDefaultUrlTemplates = array(     "list" => "index.php",     "element" => "#IBLOCK_ID#/#ELEMENT_ID#.php?SID=#SECTION_ID#" ); // and the following array is passed in the input parameters $arParams["SEF_URL_TEMPLATES"] = array(     "element" => "#IBLOCK_ID#/#SECTION_ID#/#ELEMENT_ID#.php" ); // calling MakeComponentUrlTemplates: $arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates, $arParams["SEF_URL_TEMPLATES"]); // will create $arUrlTemplates: $arUrlTemplates = array( "list" => "index.php", "element" => "#IBLOCK_ID#/#SECTION_ID#/#ELEMENT_ID#.php" )

See Also

  • Compound component structure
  • CComponentEngine::ParseComponentPath