本文整理汇总了PHP中PHPParser::FindComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPParser::FindComponent方法的具体用法?PHP PHPParser::FindComponent怎么用?PHP PHPParser::FindComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPParser
的用法示例。
在下文中一共展示了PHPParser::FindComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
}
if ($strWarning == "") {
// try to read parameters from script file
/* Try to open script containing the component call */
if (!$src_path || $src_line <= 0) {
$strWarning .= GetMessage("comp_prop_err_param") . "<br>";
} else {
$abs_path = $io->RelativeToAbsolutePath($src_path);
$f = $io->GetFile($abs_path);
$filesrc = $f->GetContents();
if (!$filesrc || $filesrc == "") {
$strWarning .= GetMessage("comp_prop_err_open") . "<br>";
}
}
if ($strWarning == "") {
$arComponent = PHPParser::FindComponent($_GET["component_name"], $filesrc, $src_line);
if ($arComponent === false) {
$strWarning .= GetMessage("comp_prop_err_comp") . "<br>";
} else {
$arValues = $arComponent["DATA"]["PARAMS"];
}
}
}
if ($strWarning == "") {
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_GET["action"] == "refresh") {
// parameters were changed by "ok" button
// we need to refresh the component description with new values
$arValues = array_merge($arValues, $_POST);
}
$curTemplate = isset($_POST["NEW_COMPONENT_TEMPLATE"]) ? $_POST["NEW_COMPONENT_TEMPLATE"] : $_GET["component_template"];
$arComponentDescription = CComponentUtil::GetComponentDescr($_GET["component_name"]);
示例2: GetMessage
}
if ($strWarning == "") {
// try to read parameters from script file
/* Try to open script containing the component call */
if (!$src_path || $src_line <= 0) {
$strWarning .= GetMessage("comp_prop_err_param") . "<br>";
} else {
$abs_path = $io->RelativeToAbsolutePath($src_path);
$f = $io->GetFile($abs_path);
$filesrc = $f->GetContents();
if (!$filesrc || $filesrc == "") {
$strWarning .= GetMessage("comp_prop_err_open") . "<br>";
}
}
if ($strWarning == "") {
$arComponent = PHPParser::FindComponent($componentName, $filesrc, $src_line);
if ($arComponent === false) {
$strWarning .= GetMessage("comp_prop_err_comp") . "<br>";
} else {
$arValues = $arComponent["DATA"]["PARAMS"];
}
}
}
if ($strWarning == "") {
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_GET["action"] == "refresh") {
// parameters were changed by "ok" button
// we need to refresh the component description with new values
$arValues = array_merge($arValues, $_POST);
}
$curTemplate = isset($_POST["COMPONENT_TEMPLATE"]) ? $_POST["COMPONENT_TEMPLATE"] : $componentTemplate;
$data = CComponentParamsManager::GetComponentProperties($componentName, $curTemplate, $templateId, $arValues);