本文整理汇总了PHP中Profile::range方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::range方法的具体用法?PHP Profile::range怎么用?PHP Profile::range使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::range方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionView
/**
* Displays a particular model.
*/
public function actionView()
{
$model = $this->loadModel();
$attributes = array('id', 'username');
$profileFields = ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach ($profileFields as $field) {
array_push($attributes, array('label' => UserModule::t($field->title), 'name' => $field->varname, 'type' => 'raw', 'value' => $field->widgetView($model->profile) ? $field->widgetView($model->profile) : ($field->range ? Profile::range($field->range, $model->profile->getAttribute($field->varname)) : $model->profile->getAttribute($field->varname))));
}
}
array_push($attributes, 'password', 'email', 'activkey', array('name' => 'createtime', 'value' => date("d.m.Y H:i:s", $model->createtime)), array('name' => 'lastvisit', 'value' => $model->lastvisit ? date("d.m.Y H:i:s", $model->lastvisit) : UserModule::t("Not visited")), array('name' => 'superuser', 'value' => User::itemAlias("AdminStatus", $model->superuser)), array('name' => 'status', 'value' => User::itemAlias("UserStatus", $model->status)));
$this->render('view', array('model' => $model, 'attributes' => $attributes));
}
示例2: array
<?php
$this->breadcrumbs = array(UserModule::t('Users') => array('/user/admin'), $model->username);
?>
<h1><?php
echo UserModule::t('View User') . ' "' . $model->username . '"';
?>
</h1>
<?php
echo $this->renderPartial('_menu', array('list' => array(CHtml::link(UserModule::t('Create User'), array('create')), CHtml::link(UserModule::t('Update User'), array('update', 'id' => $model->id)), CHtml::linkButton(UserModule::t('Delete User'), array('submit' => array('delete', 'id' => $model->id), 'confirm' => UserModule::t('Are you sure to delete this item?'))))));
$attributes = array('id', 'username');
$profileFields = ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach ($profileFields as $field) {
array_push($attributes, array('label' => UserModule::t($field->title), 'name' => $field->varname, 'type' => 'raw', 'value' => $field->widgetView($model->profile) ? $field->widgetView($model->profile) : ($field->range ? Profile::range($field->range, $model->profile->getAttribute($field->varname)) : $model->profile->getAttribute($field->varname))));
}
}
array_push($attributes, 'password', 'email', 'activkey', array('name' => 'createtime', 'value' => date("d.m.Y H:i:s", $model->createtime)), array('name' => 'lastvisit', 'value' => $model->lastvisit ? date("d.m.Y H:i:s", $model->lastvisit) : UserModule::t("Not visited")), array('name' => 'superuser', 'value' => User::itemAlias("AdminStatus", $model->superuser)), array('name' => 'status', 'value' => User::itemAlias("UserStatus", $model->status)));
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attributes));
示例3: elseif
</div>
<div class="right">
<?if ($field->widgetEdit($profile)) {
echo $field->widgetEdit($profile);
} elseif ($field->field_type=="DATE") {
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'attribute'=>$field->varname,
'model'=>$profile,
'language'=>Yii::app()->language,
'options'=>array(
'changeYear'=>true,
'yearRange'=>'-50:-15',
'dateFormat'=>'yy-mm-dd',
),
'htmlOptions'=>array('size'=>30,'class'=>'date')
));
} elseif ($field->range) {
echo $form->dropDownList($profile,$field->varname,Profile::range($field->range));
} elseif ($field->field_type=="TEXT") {
echo $form->textArea($profile,$field->varname,array('rows'=>6, 'cols'=>50));
} else {
echo $form->textField($profile,$field->varname,array('size'=>60,'maxlength'=>(($field->field_size)?$field->field_size:255)));
}
echo $form->error($profile,$field->varname); ?>
</div>
</div>
<?php
}
}
?>
示例4: foreach
?>
</td>
</tr>
<?php
$profileFields = ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach ($profileFields as $field) {
//echo "<pre>"; print_r($profile); die();
?>
<tr>
<th class="label"><?php
echo CHtml::encode(UserModule::t($field->title));
?>
</th>
<td><?php
echo $field->widgetView($profile) ? $field->widgetView($profile) : CHtml::encode($field->range ? Profile::range($field->range, $profile->getAttribute($field->varname)) : $profile->getAttribute($field->varname));
?>
</td>
</tr>
<?php
}
//$profile->getAttribute($field->varname)
}
?>
<tr>
<th class="label"><?php
echo CHtml::encode($model->getAttributeLabel('email'));
?>
</th>
<td><?php
echo CHtml::encode($model->email);
示例5: array
<?php
echo $form->error($profile, $field->varname);
?>
</div>
<br/>
<?php
} else {
?>
<div class="row">
<strong><?php
echo TbHtml::encode(UserModule::t($field->title));
?>
:</strong>
<?php
echo TbHtml::encode($field->widgetView($model->profile) ? $field->widgetView($model->profile) : ($field->range ? Profile::range($field->range, $model->profile->getAttribute($field->varname)) : $model->profile->getAttribute($field->varname)));
?>
</div>
<br/>
<?php
}
}
}
?>
<div class="row buttons">
<?php
echo TbHtml::button(UserModule::t('Save'), array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'submit' => ''));
?>
<?php
echo TbHtml::linkButton(UserModule::t('Cancel'), array('color' => TbHtml::BUTTON_COLOR_DANGER, 'url' => Yii::app()->request->getUrlReferrer()));
?>
示例6: foreach
echo CHtml::errorSummary($model);
echo CHtml::errorSummary($profile);
?>
<?php
$profileFields = $profile->getFields();
if ($profileFields) {
foreach ($profileFields as $field) {
?>
<div class="row">
<?php
echo CHtml::activeLabelEx($profile, $field->varname);
if ($field->widgetEdit($profile)) {
echo $field->widgetEdit($profile);
} elseif ($field->range) {
echo CHtml::activeDropDownList($profile, $field->varname, Profile::range($field->range));
} elseif ($field->field_type == "TEXT") {
echo CHtml::activeTextArea($profile, $field->varname, array('rows' => 6, 'cols' => 50));
} else {
echo CHtml::activeTextField($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255));
}
echo CHtml::error($profile, $field->varname);
?>
</div>
<?php
}
}
?>
<div class="row">
<?php
echo CHtml::activeLabelEx($model, 'username');
示例7: foreach
<?php
$profileFields = $profile->getFields();
if ($profileFields) {
foreach ($profileFields as $field) {
if ($field->widgetEdit($profile)) {
echo '<div class="form-group">';
echo '<label class="control-label col-md-3">';
echo $form->labelEx($profile, $field->varname);
echo '</label>';
echo '<div class="col-md-9">';
echo $field->widgetEdit($profile, array('class' => 'form-control'));
echo '</div>';
echo '</div>';
} elseif ($field->range) {
echo $form->dropDownListGroup($profile, $field->varname, array('wrapperHtmlOptions' => array(), 'widgetOptions' => array('data' => Profile::range($field->range), 'htmlOptions' => array())));
} elseif ($field->field_type == "TEXT") {
echo $form->textAreaGroup($profile, $field->varname, array('wrapperHtmlOptions' => array(), 'widgetOptions' => array('htmlOptions' => array('rows' => 5))));
} else {
echo $form->textFieldGroup($profile, $field->varname, array('widgetOptions' => array('htmlOptions' => array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255))));
}
}
}
echo $form->textFieldGroup($model, 'username', array('widgetOptions' => array('htmlOptions' => array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255))));
echo $form->error($model, 'username');
echo $form->textFieldGroup($model, 'email', array('widgetOptions' => array('htmlOptions' => array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255))));
echo $form->error($model, 'email');
?>
<div class="form-actions text-right">
<?php
$this->widget('booster.widgets.TbButton', array('buttonType' => 'submit', 'context' => 'primary', 'label' => 'Save'));
示例8: lomake
function lomake($profile, $field, $form)
{
/* lomake */
if ($field->varname == 'alennus_loppu_pvm') {
echo '<div class="form-inline">' . $form->labelEx($profile, $field->varname, array('class' => 'form-group')) . '
<i class="fa fa-question-circle form-group text-success" data-toggle="tooltip" title="Jos haluat myydä käyttöaikaa alennuksella, niin määritä tässä alennuksen lopetuspäivämäärä."></i>
</div>';
} elseif ($field->varname == 'alennus_prosentti') {
echo '<div class="form-inline">' . $form->labelEx($profile, $field->varname, array('class' => 'form-group')) . '
<i class="fa fa-question-circle form-group text-success" data-toggle="tooltip" title="Jos haluat myydä käyttöaikaa alennuksella, niin määritä tässä alennusprosentti."></i>
</div>';
} else {
echo $form->labelEx($profile, $field->varname);
}
if ($widgetEdit = $field->widgetEdit($profile)) {
echo $widgetEdit;
} elseif ($field->range) {
echo $form->dropDownList($profile, $field->varname, Profile::range($field->range), array('class' => 'form-control'));
} elseif ($field->varname == "alennus_loppu_pvm") {
echo $form->textField($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255, 'class' => 'form-control datepicker'));
} elseif ($field->field_type == "TEXT") {
echo $form->textArea($profile, $field->varname, array('rows' => 6, 'cols' => 50, 'class' => 'form-control'));
} elseif ($field->field_type == "FLOAT") {
echo $form->numberField($profile, $field->varname, array('class' => 'form-control', 'step' => '0.01'));
} else {
echo $form->textField($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255, 'class' => 'form-control'));
}
echo $form->error($profile, $field->varname);
/* lomake */
}
示例9: array
$form = $this->beginWidget('UActiveForm', array('id' => 'registration-form', 'enableAjaxValidation' => true, 'disableAjaxValidationAttributes' => array('RegistrationForm_verifyCode'), 'clientOptions' => array('validateOnSubmit' => true), 'htmlOptions' => array('class' => 'form-horizontal form-groups-bordered validate', 'role' => 'form', 'enctype' => 'multipart/form-data')));
$profileFields = $profile->getFields();
if ($profileFields) {
foreach ($profileFields as $field) {
?>
<div class="form-group">
<?php
echo $form->labelEx($profile, $field->varname, array('class' => 'col-sm-3 control-label'));
?>
<div class="col-sm-5">
<?php
if ($widgetEdit = $field->widgetEdit($profile)) {
echo $widgetEdit;
} elseif ($field->range) {
echo $form->dropDownList($profile, $field->varname, Profile::range($field->range), array('class' => 'form-control'));
} elseif ($field->field_type == "TEXT") {
echo $form->textArea($profile, $field->varname, array('rows' => 6, 'cols' => 50, 'class' => 'form-control'));
} else {
echo $form->textField($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255, 'class' => 'form-control'));
}
?>
</div>
<?php
echo $form->error($profile, $field->varname);
?>
</div>
<?php
}
}
?>
示例10: array
?>
<div style="text-align:center"><h3># 会员注册 #</h3></div>
<p class="help-block" style="text-align:center;padding-bottom:10px">请输入您的注册信息:</p>
<?php
//echo $form->errorSummary(array($model, $profile));
?>
<?php
echo $form->textFieldControlGroup($model, 'username');
?>
<?php
echo $form->passwordFieldControlGroup($model, 'password', array('hint' => UserModule::t("Minimal password length 4 symbols.")));
?>
<?php
echo $form->passwordFieldControlGroup($model, 'verifyPassword');
?>
<?php
echo $form->textFieldControlGroup($model, 'email');
?>
<?php
$profileFields = $profile->getFields();
if ($profileFields) {
foreach ($profileFields as $field) {
if ($field->widgetEdit($profile)) {
echo $field->widgetEdit($profile);
} elseif ($field->range) {
echo $form->dropDownListControlGroup($profile, $field->varname, Profile::range($field->range));
} elseif ($field->field_type == "TEXT") {
echo $form->textAreaControlGroup($profile, $field->varname, array('rows' => 6, 'cols' => 50));
} else {
echo $form->textFieldControlGroup($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255));
示例11: foreach
$profileFields = $profile->getFields();
if ($profileFields) {
foreach ($profileFields as $field) {
?>
<div class="row form-group">
<div class="col-md-3 control-label">
<?php
echo $form->labelEx($profile, $field->varname);
?>
</div>
<div class="col-md-4">
<?php
if ($widgetEdit = $field->widgetEdit($profile)) {
echo $widgetEdit;
} elseif ($field->range) {
echo $form->dropDownList($profile, $field->varname, Profile::range($field->range), ['class' => 'form-control input-md']);
} elseif ($field->field_type == "TEXT") {
echo CHtml::activeTextArea($profile, $field->varname, array('rows' => 6, 'cols' => 50));
} else {
echo $form->textField($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255, 'class' => 'form-control input-md'));
}
?>
<?php
echo $form->error($profile, $field->varname);
?>
</div>
</div>
<?php
}
}
?>
示例12: array
);
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>$attributes
));
$prof_attrs = array();
$profileFields=ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach($profileFields as $field) {
array_push($prof_attrs, array(
'label' => Users::t($field->title),
'name' => $field->varname,
'stype'=>'raw',
'value' => ($field->widgetView($model->profile)?$field->widgetView($model->profile):
(($field->range)?Profile::range($field->range,$model->profile->getAttribute($field->varname)):
$model->profile->getAttribute($field->varname))),
));
}
}
echo 'Профиль';
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model->profile,
'attributes'=>$prof_attrs,
));
?>
示例13: foreach
<?php
use marsoltys\yii2user\models\ProfileField;
use marsoltys\yii2user\Module;
use yii\widgets\DetailView;
$this->params['breadcrumbs'] = [['label' => Module::t('Users'), 'url' => ['index']], $model->username];
Module::getInstance()->setMenu([['label' => Module::t('List User'), 'url' => ['index']]]);
?>
<h1><?php
echo Module::t('View User') . ' "' . $model->username . '"';
?>
</h1>
<?php
// For all users
$attributes = ['username'];
$profileFields = ProfileField::find()->forAll()->sort()->all();
if ($profileFields) {
foreach ($profileFields as $field) {
array_push($attributes, ['label' => Module::t($field->title), 'attribute' => $field->varname, 'value' => $field->widgetView($model->profile) ? $field->widgetView($model->profile) : ($field->range ? Profile::range($field->range, $model->profile->getAttribute($field->varname)) : $model->profile->getAttribute($field->varname))]);
}
}
array_push($attributes, 'create_at', ['attribute' => 'lastvisit_at', 'value' => $model->lastvisit_at != '0000-00-00 00:00:00' ? $model->lastvisit_at : Module::t('Not visited')]);
echo DetailView::widget(['model' => $model, 'attributes' => $attributes]);
示例14: array
<?php
$attributes = array(
'username',
'email',
);
$profileFields=ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach($profileFields as $field) {
array_push($attributes,array(
'label' => UserModule::t($field->title),
'name' => $field->varname,
'type'=>'raw',
'value' => (($field->widgetView($model->profile))?$field->widgetView($model->profile):(($field->range)?Profile::range($field->range,$model->profile->getAttribute($field->varname)):$model->profile->getAttribute($field->varname))),
));
}
}
array_push($attributes,
'create_at',
'lastvisit_at',
array(
'name' => 'status',
'value' => User::itemAlias("UserStatus",$model->status),
)
);
$this->widget('bootstrap.widgets.TbDetailView', array(
'data'=>$model,
示例15: echo
</div>
<?php endif; ?>
<table class="dataGrid">
<tr>
<th class="label"><?php echo CHtml::encode($model->getAttributeLabel('username')); ?></th>
<td><?php echo CHtml::encode($model->username); ?></td>
</tr>
<?php
$profileFields=ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach($profileFields as $field) {
//echo "<pre>"; print_r($profile); die();
?>
<tr>
<th class="label"><?php echo CHtml::encode(UserModule::t($field->title)); ?></th>
<td><?php echo (($field->widgetView($profile))?$field->widgetView($profile):CHtml::encode((($field->range)?Profile::range($field->range,$profile->getAttribute($field->varname)):$profile->getAttribute($field->varname)))); ?></td>
</tr>
<?php
}//$profile->getAttribute($field->varname)
}
?>
<tr>
<th class="label"><?php echo CHtml::encode($model->getAttributeLabel('email')); ?></th>
<td><?php echo CHtml::encode($model->email); ?></td>
</tr>
<tr>
<th class="label"><?php echo CHtml::encode($model->getAttributeLabel('create_at')); ?></th>
<td><?php echo $model->create_at; ?></td>
</tr>
<tr>
<th class="label"><?php echo CHtml::encode($model->getAttributeLabel('lastvisit_at')); ?></th>