Hi there!
Getting started on Yii… Having a simple problem to solve.
public function properties()
{
$location = wm()->get('deal.helper')->location();
if($location)
$this->model->location = $location;
return array(
'action' => array('/deal/subscribe'),
'elements' => array(
'location' => array('type' => 'dropdownlist', 'label' => $this->t('City'),
'items' => wm()->get('location.helper')->locationsAsList()),
'email' => array('type'=>'text', 'label'=>$this->t('Your email address')),
),
'buttons' => array(
'submit' => array('type' => 'submit',
'label' => $this->t('Subscribe'))
),
'model' => $this->model
);
}
I have this code on a form that correctly gets the current page location and all other possible ones, show them on a dropdownlist and let people subscribe to my newsletter. But I’m trying to remove the dropdown and just show the current location name as a text - since it’s highly uncommon someone register to a city other that yours -, speeding the process. How can I do that?