Answer the question
In order to leave comments, you need to log in
Why is the variable not being restored from the template?
I am writing the first complex component in my life
And in this place:
//шаблоны запросов
$arDefaultUrlTemplates404 = array(
"list" => "/LinuxSoftComplex/",
"detail" => "#ELEMENT_ID#/",
);
$arComponentVariables = array(
"ELEMENT_ID",
"ELEMENT_CODE",
);
$arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates404, $arParams["SEF_URL_TEMPLATES"]);
$arVariables = array();
$componentPage = CComponentEngine::ParseComponentPath(
$arParams["SEF_FOLDER"],
$arUrlTemplates,
$arVariables
);
$arVariables
always get an empty one (and should, as I understand it, give an array of restored values). i.e. I click on the view link мой-сайт/LinuxSoftComplex/360/
and expect to get in $arVariables
360, but it's empty. What am I doing wrong?
Answer the question
In order to leave comments, you need to log in
/LinuxSoftComplex/ - should be in $arParams["SEF_FOLDER"], but in an array
$arDefaultUrlTemplates404 = array(
"list" => "/LinuxSoftComplex/",
"detail" => "#ELEMENT_ID#/",
);
$arDefaultUrlTemplates404 = array(
"list" => "",
"detail" => "#ELEMENT_ID#/",
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question