本文整理汇总了PHP中SPRequest::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP SPRequest::exists方法的具体用法?PHP SPRequest::exists怎么用?PHP SPRequest::exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPRequest
的用法示例。
在下文中一共展示了SPRequest::exists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRequest
/**
* Gettin data from request for this object
* @param string $prefix
* @param string $request
*/
public function getRequest($prefix = null, $request = 'POST')
{
$prefix = $prefix ? $prefix . '_' : null;
/* get data types of my properties */
$properties = get_object_vars($this);
Sobi::Trigger($this->name(), ucfirst(__FUNCTION__) . 'Start', array(&$properties));
/* and of the parent properties */
$types = array_merge($this->types(), self::$types);
foreach ($properties as $property => $values) {
/* if this is an internal variable */
if (substr($property, 0, 1) == '_') {
continue;
}
/* if no data type has been declared */
if (!isset($types[$property])) {
continue;
}
/* if there was no data for this property ( not if it was just empty ) */
if (!SPRequest::exists($prefix . $property, $request)) {
continue;
}
/* if the declared data type has not handler in request class */
if (!method_exists('SPRequest', $types[$property])) {
Sobi::Error($this->name(), SPLang::e('Method %s does not exist!', $types[$property]), SPC::WARNING, 0, __LINE__, __FILE__);
continue;
}
/* now we get it ;) */
$this->{$property} = SPRequest::$types[$property]($prefix . $property, null, $request);
}
/* trigger plugins */
Sobi::Trigger('getRequest', $this->name(), array(&$this));
}