Difference between #1 and #4 of
Update two models with one view

Changes

Title changed

Update two models with one view

Category unchanged

Tips

Yii version unchanged

Tags changed

database, model, view, form

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’); ?>
[...]
9 3
13 followers
Viewed: 56 297 times
Version: 1.1
Category: Tips
Written by: sensorario
Last updated by: SebK
Created on: Dec 19, 2011
Last updated: 12 years ago
Update Article

Revisions

View all history