Skip to content

Instantly share code, notes, and snippets.

@andrebian
Created August 2, 2013 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrebian/6144099 to your computer and use it in GitHub Desktop.
Save andrebian/6144099 to your computer and use it in GitHub Desktop.
<?php
// código de sua View
echo $this->Form->input('email.');
// importantíssimo existir o ponto após o nome do campo, ele quem determinará que é um array
// código do Controller
if ( $this->request->is('post') ) {
foreach( $this->request->data['Model']['email'] as $email ) {
$data[] = array('campos_desejados' => 'valores_desejados', 'email' => $email);
}
$this->Model->create();
$this->Model->saveMany($data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment