本文整理汇总了PHP中eHelper::buildAttr方法的典型用法代码示例。如果您正苦于以下问题:PHP eHelper::buildAttr方法的具体用法?PHP eHelper::buildAttr怎么用?PHP eHelper::buildAttr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eHelper
的用法示例。
在下文中一共展示了eHelper::buildAttr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toDB
/**
* Called prior to save
* Sanitize and re-assemble the bbcode
*/
function toDB($code_text, $parm)
{
$code_text = trim($code_text);
if (empty($code_text)) {
return '';
}
if ($parm && !strpos($parm, '=')) {
$parm = 'class=' . $parm;
}
$parms = eHelper::scParams($parm);
$safe = array();
if (vartrue($parms['class'])) {
$safe['class'] = eHelper::secureClassAttr($parms['class']);
}
if (vartrue($parms['id'])) {
$safe['id'] = eHelper::secureIdAttr($parms['id']);
}
if (vartrue($parms['style'])) {
$safe['style'] = eHelper::secureStyleAttr($parms['style']);
}
if ($safe) {
return '[p=' . eHelper::buildAttr($safe) . ']' . $code_text . '[/p]';
}
return '[p]' . $code_text . '[/p]';
}
示例2: toDB
/**
* Called prior to save
*
*/
function toDB($code_text, $parm)
{
// just for now
if (!ADMIN) {
return $code_text;
}
// TODO - pref
// transform to class, equal sign at 0 position is not well formed parm string
if ($parm && !strpos($parm, '=')) {
$parm = 'class=' . $parm;
}
$parms = eHelper::scParams($parm);
$safe = array();
if (vartrue($parms['class'])) {
$safe['class'] = eHelper::secureClassAttr($parms['class']);
}
if (vartrue($parms['id'])) {
$safe['id'] = eHelper::secureIdAttr($parms['id']);
}
if (vartrue($parms['style'])) {
$safe['style'] = eHelper::secureStyleAttr($parms['style']);
}
if ($safe) {
return '[block=' . eHelper::buildAttr($safe) . ']' . $code_text . '[/block]';
}
return '[block]' . $code_text . '[/block]';
}
示例3: toDB
function toDB($code_text, $parm)
{
$parms = eHelper::scParams($parm);
$safe = array();
if (vartrue($parms['class'])) {
$safe['class'] = eHelper::secureClassAttr($parms['class']);
}
if (vartrue($parms['id'])) {
$safe['id'] = eHelper::secureIdAttr($parms['id']);
}
if (vartrue($parms['style'])) {
$safe['style'] = eHelper::secureStyleAttr($parms['style']);
}
if ($safe) {
return '[img ' . eHelper::buildAttr($safe) . ']' . $code_text . '[/img]';
}
return '[img]' . $code_text . '[/img]';
}
示例4: toDB
/**
* Called prior to save
* Sanitize and re-assemble the bbcode
*/
function toDB($code_text, $parm)
{
$code_text = trim($code_text);
if (empty($code_text)) {
return '';
}
$bparms = eHelper::scDualParams($parm);
$h = $bparms[1] ? intval($bparms[1]) : 2;
$parms = $bparms[2];
unset($bparms);
if (vartrue($parms['class'])) {
$safe['class'] = eHelper::secureClassAttr($parms['class']);
}
if (vartrue($parms['id'])) {
$safe['id'] = eHelper::secureIdAttr($parms['id']);
}
if (vartrue($parms['style'])) {
$safe['style'] = eHelper::secureStyleAttr($parms['style']);
}
if ($safe) {
return '[h=' . $h . '|' . eHelper::buildAttr($safe) . ']' . $code_text . '[/h]';
}
return '[h=' . $h . ']' . $code_text . '[/h]';
}