本文整理匯總了PHP中DBObject::MakeHyperLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBObject::MakeHyperLink方法的具體用法?PHP DBObject::MakeHyperLink怎麽用?PHP DBObject::MakeHyperLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBObject
的用法示例。
在下文中一共展示了DBObject::MakeHyperLink方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: MakeValueLabel
/**
* Make the most relevant label, given the value of the expression
*
* @param DBSearch oFilter The context in which this expression has been used
* @param string sValue The value returned by the query, for this expression
* @param string sDefault The default value if no relevant label could be computed
* @return The label
*/
public function MakeValueLabel($oFilter, $sValue, $sDefault)
{
$sAttCode = $this->GetName();
$sParentAlias = $this->GetParent();
$aSelectedClasses = $oFilter->GetSelectedClasses();
$sClass = $aSelectedClasses[$sParentAlias];
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
// Set a default value for the general case
$sRes = $oAttDef->GetAsHtml($sValue);
// Exceptions...
if ($oAttDef->IsExternalKey()) {
$sObjClass = $oAttDef->GetTargetClass();
$iObjKey = (int) $sValue;
if ($iObjKey > 0) {
$oObject = MetaModel::GetObject($sObjClass, $iObjKey);
$sRes = $oObject->GetHyperlink();
} else {
// Undefined
$sRes = DBObject::MakeHyperLink($sObjClass, 0);
}
} elseif ($oAttDef->IsExternalField()) {
if (is_null($sValue)) {
$sRes = Dict::S('UI:UndefinedObject');
}
}
return $sRes;
}