本文整理匯總了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))));
}