本文整理汇总了PHP中CWebUser::getstate方法的典型用法代码示例。如果您正苦于以下问题:PHP CWebUser::getstate方法的具体用法?PHP CWebUser::getstate怎么用?PHP CWebUser::getstate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWebUser
的用法示例。
在下文中一共展示了CWebUser::getstate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CWebUser
<body>
<div class="container" id="page">
<div id="header">
<div id="logo"><?php
echo CHtml::encode(Yii::app()->name);
?>
</div>
</div>
<div id="mainmenu">
<?php
$user = new CWebUser();
$this->widget('zii.widgets.CMenu', array('items' => array(array('label' => 'Home', 'url' => array('site/index')), array('label' => 'Login', 'url' => array('site/login'), 'visible' => Yii::app()->user->isGuest), array('label' => 'Admin', 'url' => array('site/admin'), 'visible' => $user->getstate('id_charge', false)), array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('site/logout'), 'visible' => !Yii::app()->user->isGuest, 'linkOptions' => array('class' => 'pull-right')))));
?>
</div><!-- mainmenu -->
<?php
if (isset($this->breadcrumbs)) {
?>
<?php
$this->widget('zii.widgets.CBreadcrumbs', array('links' => $this->breadcrumbs));
?>
<!-- breadcrumbs -->
<?php
}
?>
<?php
echo $content;
示例2: CWebUser
<div class="navbar-nav navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php
echo Yii::app()->createUrl('site/index');
?>
"><?php
echo CHtml::encode(Yii::app()->name);
?>
</a>
</div>
<div class="navbar-collapse collapse">
<?php
$user = new CWebUser();
$this->widget('zii.widgets.CMenu', array('htmlOptions' => array('class' => 'nav navbar-nav'), 'items' => array(array('label' => 'Recibos', 'url' => array('/site/recibos'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Report', 'url' => array('/site/report'), 'visible' => $user->getstate('id_charge', false)))));
$this->widget('zii.widgets.CMenu', array('htmlOptions' => array('class' => 'nav navbar-nav navbar-right'), 'activateParents' => true, 'items' => array(array('label' => 'Login', 'url' => array('/user/login'), 'visible' => Yii::app()->user->isGuest), array('label' => 'User', 'url' => array('/user/account'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Logout', 'url' => array('/user/logout'), 'visible' => !Yii::app()->user->isGuest))));
?>
</div><!--/.nav-collapse -->
</div>
</div>