本文整理汇总了PHP中Apartment::getAttributeLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Apartment::getAttributeLabel方法的具体用法?PHP Apartment::getAttributeLabel怎么用?PHP Apartment::getAttributeLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Apartment
的用法示例。
在下文中一共展示了Apartment::getAttributeLabel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderViewRows
public static function renderViewRows($rows, Apartment $model)
{
if (!$rows) {
return '';
}
foreach ($rows as $row) {
if (!$model->canShowInView($row['field'])) {
continue;
}
if ($row['standard_type'] != FormDesigner::STANDARD_TYPE_NEW && file_exists(ROOT_PATH . '/protected/views/common/apartments/fields/' . $row['field'] . '.php')) {
//
Yii::app()->controller->renderPartial('//../views/common/apartments/fields/' . $row['field'], array('data' => $model));
continue;
}
if ($row->type == FormDesigner::TYPE_REFERENCE) {
$sql = "SELECT title_" . Yii::app()->language . " FROM {{apartment_reference_values}} WHERE id=" . $model->{$row}['field'];
$value = CHtml::encode(Yii::app()->db->createCommand($sql)->queryScalar());
} else {
$value = is_string($model->{$row}['field']) ? CHtml::encode($model->{$row}['field']) : '???';
if ($row->type == FormDesigner::TYPE_TEXT_AREA_WS) {
$value = purify($model->{$row}['field']);
}
}
if ($row->type == FormDesigner::TYPE_INT && $row->measure_unit) {
$value .= ' ' . CHtml::encode($row->measure_unit);
}
if ($value) {
if ($row['standard_type'] > 0) {
echo '<dt>' . CHtml::encode($model->getAttributeLabel($row['field'])) . ':</dt>';
} else {
echo '<dt>' . CHtml::encode($row['label_' . Yii::app()->language]) . ':</dt>';
}
if ($row->field == 'phone') {
if (issetModule('tariffPlans') && issetModule('paidservices') && $model->owner_id != Yii::app()->user->id) {
if (Yii::app()->user->isGuest) {
$defaultTariffInfo = TariffPlans::getFullTariffInfoById(TariffPlans::DEFAULT_TARIFF_PLAN_ID);
if (!$defaultTariffInfo['showPhones']) {
echo '<dd>' . Yii::t('module_tariffPlans', 'Please <a href="{n}">login</a> to view', Yii::app()->controller->createUrl('/site/login')) . '</dd>';
} else {
echo '<dd><span id="owner-phone">' . CHtml::link(tc('Show phone'), 'javascript: void(0);', array('onclick' => 'generatePhone();')) . '</span>' . '</dd>';
}
} else {
if (TariffPlans::checkAllowShowPhone()) {
echo '<dd>' . $value . '</dd>';
} else {
echo '<dd>' . Yii::t('module_tariffPlans', 'Please <a href="{n}">change the tariff plan</a> to view', Yii::app()->controller->createUrl('/tariffPlans/main/index')) . '</dd>';
}
}
} else {
echo '<dd><span id="owner-phone">' . CHtml::link(tc('Show phone'), 'javascript: void(0);', array('onclick' => 'generatePhone();')) . '</span>' . '</dd>';
}
} else {
echo '<dd>' . $value . '</dd>';
}
}
}
}