if (param('useTypeRent', 1)) {
$this->type = Apartment::TYPE_RENT;
}
elseif(param('useTypeSale', 1)) {
$this->type = Apartment::TYPE_SALE;
}
if(param('useTypeSale', 1)) {
$this->type = Apartment::TYPE_SALE;
} elseif (param('useTypeRent', 1)) {
$this->type = Apartment::TYPE_RENT;
}
Денис писал(а):для платной версии как сделать?
<div class="rowold">
<?php echo $form->labelEx($model, 'type'); ?>
<?php echo $form->dropDownList($model, 'type', Apartment::getTypesArray(), array('class' => 'width240', 'id' => 'ap_type')); ?>
<?php echo $form->error($model, 'type'); ?>
</div>
public static function getTypesArray($withAll = false){
$types = array();
if($withAll){
$types[0] = tt('All', 'apartments');
}
if (param('useTypeRent', 1)) {
$types[self::TYPE_RENT] = tt('Rent', 'apartments');
}
if (param('useTypeSale', 1)) {
$types[self::TYPE_SALE] = tt('Sale', 'apartments');
}
if (param('useTypeRenting', 1)) {
$types[self::TYPE_RENTING] = tt('Rent a', 'apartments');
}
if (param('useTypeBuy', 1)) {
$types[self::TYPE_BUY] = tt('Buy a', 'apartments');
}
if (param('useTypeChange', 1)) {
$types[self::TYPE_CHANGE] = tt('Exchange', 'apartments');
}
return $types;
}
if (param('useTypeSale', 1)) {
$types[self::TYPE_SALE] = tt('Sale', 'apartments');
}
if (param('useTypeRent', 1)) {
$types[self::TYPE_RENT] = tt('Rent', 'apartments');
}
Вернуться в Вопросы и помощь по изменениям
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 39