本文整理汇总了PHP中Sobi::Clean方法的典型用法代码示例。如果您正苦于以下问题:PHP Sobi::Clean方法的具体用法?PHP Sobi::Clean怎么用?PHP Sobi::Clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sobi
的用法示例。
在下文中一共展示了Sobi::Clean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: translate
/**
* @param string $txt
* @return string
*/
private static function translate($txt)
{
if (strstr($txt, 'translate:')) {
$matches = array();
preg_match('/translate\\:\\[(.*)\\]/', $txt, $matches);
$txt = str_replace($matches[0], Sobi::Txt($matches[1]), $txt);
}
return Sobi::Clean($txt);
}
示例2: explode
/**
*
* @param mixed $attr
* @param int $index
* @return mixed
*/
public function &get($attr, $index = -1)
{
$r = null;
if (strstr($attr, '.')) {
$properties = explode('.', $attr);
} else {
$properties[0] = $attr;
}
if (isset($this->_attr[$properties[0]])) {
$var = null;
/* if array field */
if ($index > -1) {
if (is_array($this->_attr[$properties[0]]) && isset($this->_attr[$properties[0]][trim($index)])) {
$var = $this->_attr[$properties[0]][trim($index)];
} else {
Sobi::Error($this->name(), SPLang::e('ATTR_DOES_NOT_EXISTS', $attr), SPC::NOTICE, 0, __LINE__, __FILE__);
}
} else {
$var = $this->_attr[$properties[0]];
}
/* remove first field of properties */
array_shift($properties);
/* if there are still fields in array, accessing object attribute or array field */
if (is_array($properties) && count($properties)) {
foreach ($properties as $property) {
$property = trim($property);
/* it has to be SPObject subclass to access the attribute */
if (method_exists($var, 'has') && $var->has($property)) {
if (method_exists($var, 'get')) {
$var = $var->get($property);
} else {
/*@TODO need to create error object */
$r = '';
return $r;
}
} elseif (is_array($var)) {
$var = $var[$property];
} else {
/* nothing to show */
Sobi::Error($this->name(), SPLang::e('NO_PROPERTY_TO_SHOW', $attr), SPC::NOTICE, 0, __LINE__, __FILE__);
/*@TODO need to create error object */
$r = '';
return $r;
}
}
}
$r = $var;
} else {
$r = null;
}
$r = is_string($r) ? Sobi::Clean($r) : $r;
return $r;
}
示例3: ProxyDependency
/**
* */
public function ProxyDependency()
{
$path = json_decode(Sobi::Clean(SPRequest::string('path')), true);
$values = $this->loadDependencyDefinition($path);
SPFactory::mainframe()->cleanBuffer()->customHeader();
exit(json_encode(array('options' => $values, 'path' => json_encode($path))));
}