Probleme seit der Nachbildung meiner Datenbank habenPhp

PHP-Programmierer chatten hier
Anonymous
 Probleme seit der Nachbildung meiner Datenbank haben

Post by Anonymous »

Ich habe einen Controller in meinem API -Ordner namens CrudScontroller und ich habe diese Funktion. Was ich nicht verstehe, ist, dass dies ordnungsgemäß funktioniert, bevor ich Probleme mit meiner Datenbank hatte, die ich neu erstellen musste. Jetzt erhalte ich diese Fehlermeldung: < /p>
Fehlende Methode in CrudScontroller
Fehler: Die Aktion API_ADD ist nicht in Controller CrudsController < /p>
definiert

Code: Select all

> public function add()
>         {
> if ($this->request->is('post')) {
>                 $this->Crud->create();
> if ($this->Crud->save($this->request->data)) {
>
> if (isset($this->request->data['Crud']) && isset($this->request->data['Crud']['email'])) {
>
>                         $email = new CakeEmail('default'); // Use the 'default' configuration
>
> Specify the from address as 'no-reply@gmail.com'
>                     $email->from(array('no-reply@gmail.com' => 'Your Application'))
>                           ->replyTo('no-reply@gmail.com') // Set the "Reply-To" header to no-reply address
>                           ->to($this->request->data['Crud']['email'])
>                           ->subject('Notification')
>                           ->send('Your data has been successfully saved.');
>
> Debug statement
>                     $this->log('Email sent to: ' . $this->request->data['Crud']['email'], 'debug');
> else {
> Debug statement
>                     $this->log('Email not sent: Email address not found in request data', 'debug');
>                 }
>
>                 $response = array(
>                     'ok' => true,
>                     'msg' => 'saved!',
>                     'data' => $this->request->data,
>                 );
> else {
>                 $response = array(
>                     'ok' => false,
>                     'msg' => 'not saved!',
>                     'data' => $this->request->data,
>                 );
>             }
>
>             $this->set(array(
>                 'response' => $response,
>                 '_serialize' => 'response'
>             ));
>         }
>     }
< /code>
Ich habe versucht, es an öffentliche Funktionen zu bearbeiten api_add. Aber danach ist dies der Fehler, den ich bekomme. Ich möchte nur Schlüsselbeschränkungen schlägt fehl (ednc
.

Code: Select all

cruds
, Einschränkung cruds_ibfk_1 Fremdschlüssel (

Code: Select all

status_id
) Referenzen Status (

Code: Select all

id
))

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post