Just change the url
$html->link('Delete', array('action' => 'delete', 'id' =>
$fullname['Fullname']['name_id']), null, 'Are you sure?' )
to
$html->link('Delete', array('action'=>'delete',$fullname['Fullname']
['name_id'], array('escape' => false), sprintf(__('Are you sure ?',
true), $fullname['Fullname']['name_id']));
hope it will howk.
thanks,
Russell
On Sep 5, 10:08 pm, Whitty <[email protected]> wrote:
> Hi,
>
> I've just started using cakephp, and I'm working on a small program, I
> have an existing db which has a table ID called name_id
>
> but I'm unable to delete records from the table using this id using
> the delete function
>
> here is an example of the code:
>
> this is the function:
>
> function delete($id) {
> $this->Fullname->delete($id);
> $this->Session->setFlash('The name with id: '.$id.' has been
> deleted.');
> $this->redirect(array('action'=>'index'));
> }
>
> and the calling code:
>
> $html->link('Delete', array('action' => 'delete', 'name_id' =>
> $fullname['Fullname']['name_id']), null, 'Are you sure?' )
>
> I'm getting Missing argument 1 for FullNamesController::delete()
>
> in the url I'm seeing "delete/name_id:36", how do I get this function
> to work, I dont want to change the id as the db I use depends on an
> existing program?
>
> Thanks in advance, Darren
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---