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

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

Revisions

View all history