本文整理汇总了PHP中clsTinyButStrong::f_Xml_AttMove方法的典型用法代码示例。如果您正苦于以下问题:PHP clsTinyButStrong::f_Xml_AttMove方法的具体用法?PHP clsTinyButStrong::f_Xml_AttMove怎么用?PHP clsTinyButStrong::f_Xml_AttMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clsTinyButStrong
的用法示例。
在下文中一共展示了clsTinyButStrong::f_Xml_AttMove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: f_Xml_AttFind
static function f_Xml_AttFind(&$Txt, &$Loc, $Move = false, $AttDelim = false)
{
// att=div#class ; att=((div))#class ; att=+((div))#class
$Att = $Loc->PrmLst['att'];
$p = strrpos($Att, '#');
if ($p === false) {
$TagLst = '';
} else {
$TagLst = substr($Att, 0, $p);
$Att = substr($Att, $p + 1);
}
$Forward = substr($TagLst, 0, 1) === '+';
if ($Forward) {
$TagLst = substr($TagLst, 1);
}
$TagLst = explode('+', $TagLst);
$iMax = count($TagLst) - 1;
$WithPrm = false;
$LocO =& $Loc;
foreach ($TagLst as $i => $Tag) {
$LevelStop = false;
while (strlen($Tag) > 1 and substr($Tag, 0, 1) === '(' and substr($Tag, -1, 1) === ')') {
if ($LevelStop === false) {
$LevelStop = 0;
}
$LevelStop++;
$Tag = trim(substr($Tag, 1, strlen($Tag) - 2));
}
if ($i == $iMax) {
$WithPrm = true;
}
$Pos = $Forward ? $LocO->PosEnd + 1 : $LocO->PosBeg - 1;
unset($LocO);
$LocO = clsTinyButStrong::f_Xml_FindTag($Txt, $Tag, true, $Pos, $Forward, $LevelStop, $WithPrm, $WithPrm);
if ($LocO === false) {
return false;
}
}
$Loc->AttForward = $Forward;
$Loc->AttTagBeg = $LocO->PosBeg;
$Loc->AttTagEnd = $LocO->PosEnd;
$Loc->AttDelimChr = false;
if (isset($LocO->PrmLst[$Att])) {
// The attribute is existing
$p = $LocO->PrmPos[$Att];
$Loc->AttBeg = $p[0];
$p[3]--;
while ($Txt[$p[3]] === ' ') {
$p[3]--;
}
// external end of the attribute, may has an extra spaces
$Loc->AttEnd = $p[3];
$Loc->AttDelimCnt = $p[5];
$Loc->AttDelimChr = $p[4];
if ($p[1] > $p[0] and $p[2] > $p[1]) {
//$Loc->AttNameEnd = $p[1];
$Loc->AttValBeg = $p[2];
} else {
// attribute without value
//$Loc->AttNameEnd = $p[3];
$Loc->AttValBeg = false;
}
} else {
// The attribute is not yet existing
$Loc->AttDelimCnt = 0;
$Loc->AttBeg = false;
$Loc->AttName = $Att;
}
// Search for a delimitor
if ($Loc->AttDelimCnt == 0 and isset($LocO->PrmPos)) {
foreach ($LocO->PrmPos as $p) {
if ($p[5] > 0) {
$Loc->AttDelimChr = $p[4];
}
}
}
if ($Move) {
return clsTinyButStrong::f_Xml_AttMove($Txt, $Loc, $AttDelim);
}
return true;
}