本文整理匯總了PHP中Groups::isAdmin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Groups::isAdmin方法的具體用法?PHP Groups::isAdmin怎麽用?PHP Groups::isAdmin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Groups
的用法示例。
在下文中一共展示了Groups::isAdmin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testBasicFixture
/**
* A basic fixture test example
*
* @return void
*/
public function testBasicFixture()
{
$user = Sentry::findUserByLogin('superuser@saasventure.com');
$this->assertEquals('Benevolent', $user->first_name);
$this->assertEquals('Dictator', $user->last_name);
$brand = Groups::getBrandProvider()->findByTitle('BizGym');
$this->assertTrue(Groups::isAdmin($user->id, $brand->id));
}
示例2:
<li><a href="/Views/User/dashboard.php">Overview <span class="sr-only">(current)</span></a></li>
<li><a href="/Views/User/profile.php">Profile</a></li>
<li><a href="/Views/Friends/manager.php">Friends</a></li>
<li class="active"><a href="/Views/Groups/manager.php">Groups</a></li>
<li><a href="/Views/Events/manager.php">Events</a></li>
</ul>
<ul class="nav nav-sidebar">
<li><a href="/Views/Business/manager.php">Buisness</a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<?php
$results = $groups->getGroup();
// Edit only for admin
$adminCheck = $groups->isAdmin();
echo "<script>console.log('isAdmin: " . $adminCheck . "');</script>";
if ($adminCheck) {
echo '<div class="row">';
echo '<div class="col-md-12"><a class="btn btn-info btn-raised" style="float: right;" data-toggle="modal" data-dismiss="modal" data-target="#EditG">Edit Group</a></div>';
echo '</div>';
}
?>
<div class="row placeholders panel panel-primary" style="margin-top:15px;">
<!-- <div class="" style="margin-bottom:20px;"></div> -->
<div class="panel-body">
<div class="col-xs-6 col-sm-3 placeholder" style="margin:40px 0px; border-right: solid 2px gainsboro;">
<?php
$results = $groups->getGroup();
echo '<img src=" ' . $results->group_image . ' " width="100" height="100" class="img-responsive" alt="Generic placeholder thumbnail">';