Revision #2 has been created by sensorario on Dec 19, 2011, 3:20:20 PM with the memo:
Fixed some code
« previous (#1) next (#3) »
Changes
Title
unchanged
Update two model with one view
Category
unchanged
Tips
Yii version
unchanged
Tags
unchanged
Content
changed
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
```php
<?php $form = $this->beginWidget(‘CActiveForm’, array(
‘id’ => ‘
anagraficheusers-form’,
‘enableAjaxValidation’ => false )); ?>
<?php echo $form->labelEx($model, ‘username’); ?>[...]
```php
<?php $form = $this->beginWidget(‘CActiveForm’, array(
‘id’ => ‘anagraficheusers-form’,
‘enableAjaxValidation’ => false )); ?>
<?php echo $form->labelEx($model, ‘username’); ?>
<?php echo $form->textField($model, ‘username’, array(‘size’ => 60, ‘maxlength’ => 250)); ?>
<?php echo $form->error($model, ‘username’); ?>
<?php echo $form->labelEx(Emails::model(), ‘email’); ?>[...]