本文整理汇总了PHP中LimeExpressionManager::GetVarAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP LimeExpressionManager::GetVarAttribute方法的具体用法?PHP LimeExpressionManager::GetVarAttribute怎么用?PHP LimeExpressionManager::GetVarAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LimeExpressionManager
的用法示例。
在下文中一共展示了LimeExpressionManager::GetVarAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProcessBooleanExpression
/**
* Process an expression and return its boolean value
* @param <type> $expr
* @param <type> $groupSeq - needed to determine whether using variables before they are declared
* @param <type> $questionSeq - needed to determine whether using variables before they are declared
* @return <type>
*/
public function ProcessBooleanExpression($expr, $groupSeq = -1, $questionSeq = -1)
{
$this->groupSeq = $groupSeq;
$this->questionSeq = $questionSeq;
$expr = $this->ExpandThisVar($expr);
$status = $this->RDP_Evaluate($expr);
if (!$status) {
return false;
// if there are errors in the expression, hide it?
}
$result = $this->GetResult();
if (is_null($result)) {
return false;
// if there are errors in the expression, hide it?
}
// if ($result == 'false') {
// return false; // since the string 'false' is not considered boolean false, but an expression in JavaScript can return 'false'
// }
// return !empty($result);
// Check whether any variables are irrelevant - making this comparable to JavaScript which uses LEManyNA(varlist) to do the same thing
foreach ($this->GetVarsUsed() as $var) {
if (!preg_match("/^.*\\.(NAOK|relevanceStatus)\$/", $var)) {
if (!LimeExpressionManager::GetVarAttribute($var, 'relevanceStatus', false, $groupSeq, $questionSeq)) {
return false;
}
}
}
return (bool) $result;
}
示例2: GetVarAttribute
/**
* Get information about the variable, including JavaScript name, read-write status, and whether set on current page.
* @param <type> $varname
* @return <type>
*/
private function GetVarAttribute($name, $attr, $default)
{
return LimeExpressionManager::GetVarAttribute($name, $attr, $default, $this->groupSeq, $this->questionSeq);
}