Documentation

MakeComponentUrlTemplates

array
MakeComponentUrlTemplates(
 array arDefaultUrlTemplates,
 array arCustomUrlTemplates
);

The method supports CNC mode in complex components. This method receives on input both default path templates and path templates passed in the component input parameters. It also replaces those path templates that were re-defined in the component input parameters. Static method.

Parameters

ParameterDescription
arDefaultUrlTemplates Array of default path templates.
arCustomUrlTemplates Array of path templates, passed in the component input parameters.

Returned value

Array of path templates.

Example

// if array of path templates is as follows by default
$arDefaultUrlTemplates = array(
	"list" => "index.php",
	"element" => "#IBLOCK_ID#/#ELEMENT_ID#.php?SID=#SECTION_ID#"
);

// and the following array was passed in the input parameters
$arParams["SEF_URL_TEMPLATES"] = array(
	"element" => "#IBLOCK_ID#/#SECTION_ID#/#ELEMENT_ID#.php"
);

// then, after the method is called:
$arUrlTemplates = 
    CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates, 
                                                $arParams["SEF_URL_TEMPLATES"]);

// array $arUrlTemplates will look as follows
$arUrlTemplates = array(
	"list" => "index.php",
	"element" => "#IBLOCK_ID#/#SECTION_ID#/#ELEMENT_ID#.php"
)

See Also
  • Composite Component Structure
  • CComponentEngine::ParseComponentPath


  • © «Bitrix24», 2001-2022
    Up