本文整理汇总了PHP中Feature::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Feature::getByID方法的具体用法?PHP Feature::getByID怎么用?PHP Feature::getByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feature
的用法示例。
在下文中一共展示了Feature::getByID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hasFeature
public function hasFeature($feature)
{
// checking if we got feature ID instead of object for backwards compatibility
if (is_int($feature)) {
$feature = Feature::getByID($feature);
}
return $feature->isEnabledForUser($this);
}
示例2: header
?>
<h1>400 User ID is not specified</h1><?php
exit;
}
$user = User::getUser($_GET['id']);
if (is_null($user)) {
header("HTTP/1.0 404 User Not Found");
?>
<h1>404 User Not Found</h3><?php
exit;
}
if (array_key_exists("savefeatures", $_POST)) {
$features_to_set = array();
if (array_key_exists("feature", $_POST) && is_array($_POST['feature'])) {
foreach (array_keys($_POST['feature']) as $featureid) {
$feature = Feature::getByID($featureid);
if (!is_null($feature) && $feature->isEnabled()) {
$features_to_set[] = $feature;
}
}
}
$user->setFeatures($features_to_set);
}
#$ADMIN_SECTION = 'registrations';
require_once dirname(__FILE__) . '/header.php';
?>
<h2>User information: <?php
echo UserTools::escape($user->getName());
?>
</h2>