I'm new to CakePHP. When I tried to use scaffold, it works very well.
However, I am a careless man and always click the wrong link. I
eventually click on "delete" link and delete some of my records. I've
changed the following files to make a confirmation before the delete
action taken place:
/cake/libs/view/templates/scaffolds/edit.thtml
Line 60:
echo "<li>".$html->link('Delete '.Inflector::humanize($modelName),
$path.$this->viewPath.'/delete/'.$data[$modelKey][$this->controller->{$modelName}->primaryKey],
null, 'Are you sure you want to delete this entry?')."</li>";
/cake/libs/view/templates/scaffolds/list.thtml
Line 118:
<?php echo
$html->link('Delete',$path.$this->viewPath."/delete/{$row[$modelKey][$this->controller->{$model}->primaryKey]}/",
null, 'Are you sure you want to delete this entry?')?>
/cake/libs/view/templates/scaffolds/show.thtml
Line 95:
echo "<li>".$html->link('Delete
'.Inflector::humanize($objModel->name),
$path.$this->viewPath.'/delete/'.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey],
null, 'Are you sure you want to delete this entry?')."</li>";
Line 196:
<?php echo
$html->link('Delete',$path.Inflector::underscore($controller)."/delete/{$row[$this->controller->{$modelName}->{$association}->primaryKey]}/",
null, 'Are you sure you want to delete this entry?')?>
Line 215:
<?php echo
$html->link('Delete',$path.Inflector::underscore($controller)."/delete/{$row[$this->controller->{$modelName}->primaryKey]}/",
null, 'Are you sure you want to delete this entry?')?>
Hope this help and can be added in future.
Michael Wai
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---