Hello!
I have one table called Projects and another table called Directors in
my database:
Project belongsTo Director
Director hasMany Project
Adding a new project, I have a select of directors and I want that
they appear with their firstname and lastname and not with their Id.
The fields of the table Director are: Id, firstname, lastname.
I saw how to do it here:

http://groups.google.com/group/cake-php/browse_thread/thread/d4aa1929ce4d61c7/edcacb9354ff1f7a?lnk=gst&q=displayfield#edcacb9354ff1f7a

And the select has the directors with full_name(firstname+lastname).
But the problem is that if I do the index view of projects:

<?php foreach ($projects as $project):?>
<?php echo $project['Project']['firstname']?>
<?php echo $project['Director']['firstname']?> <?php echo
$proyecto['Director']['lastname']?>
<?php endforeach; ?>

And projects_controller:

function index() {
                $this->Project->recursive = 2;
                $this->set('projects', $this->paginate());
        }

The projects and their directors appear correctly but, I obtain these
warnings:

Notice (8): Undefined offset:  0 [CORE/cake/libs/model/datasources/
dbo_source.php, line 882]
Notice (8): Undefined index:  Profesor [CORE/app/models/director.php,
line 63]
Warning (2): array_key_exists() [function.array-key-exists]: The
second argument should be either an array or an object [CORE/app/
models/director.php, line 63]

Why these warnings appear? How can I solve it?
I hope you can help me.
Thanks and regards

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to