本文整理汇总了PHP中YumUser::itemAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP YumUser::itemAlias方法的具体用法?PHP YumUser::itemAlias怎么用?PHP YumUser::itemAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YumUser
的用法示例。
在下文中一共展示了YumUser::itemAlias方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
?>
</div>
<div style="float: right; margin: 10px;">
<div class="row">
<?php
echo $form->labelEx($model, 'superuser');
echo $form->dropDownList($model, 'superuser', YumUser::itemAlias('AdminStatus'));
echo $form->error($model, 'superuser');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'status');
echo $form->dropDownList($model, 'status', YumUser::itemAlias('UserStatus'));
echo $form->error($model, 'status');
?>
</div>
<?php
if (Yum::hasModule('role')) {
Yii::import('application.modules.role.models.*');
?>
<div class="row roles">
<p> <?php
echo Yum::t('User belongs to these roles');
?>
</p>
<?php
$this->widget('application.modules.user.components.Relation', array('model' => $model, 'relation' => 'roles', 'style' => 'dropdownlist', 'fields' => 'title', 'showAddButton' => false));
示例2: array
} else {
$this->title = Yum::t('View user "{username}"', array('{username}' => $model->username));
}
$this->breadcrumbs = array(Yum::t('Users') => array('index'), $model->username);
echo Yum::renderFlash();
if (Yii::app()->user->isAdmin()) {
$attributes = array('id');
if (!Yum::module()->loginType & UserModule::LOGIN_BY_EMAIL) {
$attributes[] = 'username';
}
if ($profiles && $model->profile) {
foreach (YumProfile::getProfileFields() as $field) {
array_push($attributes, array('label' => Yum::t($field), 'type' => 'raw', 'value' => $model->profile->getAttribute($field)));
}
}
array_push($attributes, array('name' => 'createtime', 'value' => date(UserModule::$dateFormat, $model->createtime)), array('name' => 'lastvisit', 'value' => date(UserModule::$dateFormat, $model->lastvisit)), array('name' => 'lastpasswordchange', 'value' => date(UserModule::$dateFormat, $model->lastpasswordchange)), array('name' => 'superuser', 'value' => YumUser::itemAlias("AdminStatus", $model->superuser)), array('name' => Yum::t('Activation link'), 'value' => $model->getActivationUrl()), array('name' => 'status', 'value' => YumUser::itemAlias("UserStatus", $model->status)));
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attributes));
} else {
// For all users
$attributes = array('username');
if ($profiles) {
$profileFields = YumProfile::getProfileFields();
if ($profileFields) {
foreach ($profileFields as $field) {
array_push($attributes, array('label' => Yum::t($field), 'name' => $field, 'value' => $model->profile->getAttribute($field)));
}
}
}
array_push($attributes, array('name' => 'createtime', 'value' => date(UserModule::$dateFormat, $model->createtime)), array('name' => 'lastvisit', 'value' => date(UserModule::$dateFormat, $model->lastvisit)));
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attributes));
}
示例3: date
'value' => date(UserModule::$dateFormat,$model->lastvisit),
),
array(
'name' => 'lastpasswordchange',
'value' => date(UserModule::$dateFormat,$model->lastpasswordchange),
),
array(
'name' => 'superuser',
'value' => YumUser::itemAlias("AdminStatus",$model->superuser),
),
array(
'name' => Yum::t('Activation link'),
'value' =>$model->getActivationUrl()),
array(
'name' => 'status',
'value' => YumUser::itemAlias("UserStatus",$model->status),
)
);
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>$attributes,
));
} else {
// For all users
$attributes = array(
'username',
);
if($profiles) {
示例4: date
<th class="label"><?php
echo CHtml::encode($model->getAttributeLabel('lastvisit'));
?>
</th>
<td><?php
echo date(UserModule::$dateFormat, $model->lastvisit);
?>
</td>
</tr>
<tr>
<th class="label"><?php
echo CHtml::encode($model->getAttributeLabel('status'));
?>
</th>
<td><?php
echo CHtml::encode(YumUser::itemAlias("UserStatus", $model->status));
?>
</td>
</tr>
</table>
<div id="friends">
<h2> <?php
echo Yum::t('My friends');
?>
</h2>
<?php
if (Yum::hasModule('friendship') && $model->friends) {
foreach ($friends as $friend) {
?>
<div id="friend">
示例5: array
<?php
echo $form->labelEx($user, 'username');
echo $form->textField($user, 'username');
echo $form->error($user, 'username');
?>
<?php
echo $form->labelEx($user, 'status');
echo $form->dropDownList($user, 'status', YumUser::itemAlias('UserStatus'));
echo $form->error($user, 'status');
?>
<?php
echo $form->labelEx($user, 'superuser');
echo $form->dropDownList($user, 'superuser', YumUser::itemAlias('AdminStatus'));
echo $form->error($user, 'superuser');
?>
<p> Leave password <em> empty </em> to
<?php
echo $user->isNewRecord ? 'generate a random Password' : 'keep it <em> unchanged </em>';
?>
</p>
<?php
$this->renderPartial('/user/passwordfields', array('form' => $passwordform));
?>
<?php
if (Yum::hasModule('role')) {