Hi Mike,
On 17 Apr., 22:30, MikeA <[EMAIL PROTECTED]> wrote:
> class LocationsController extends AppController {
> var $name = 'Locations';
> var $helpers = array('Form', 'Datum');
>
> function index() {
> $eintraege = $this->Location->findAll();
> $this->set('locations',$eintraege);
> }
>
> function view($id = NULL) {
> $this->Location->id = $id;
> $this->set('locatiion',$this->Location->read());
> }}
>
> ?>
>
> [...]
> Wenn ich nun jedoch auf den Lolkations-Link
> (http://xxx.xxx.xxx.xxx/locations/view/9) klicke wird ja der Lokation-
> View aufgerufen, jedoch scheint dabei ein Denkfehler meinerseits
> vorzuliegen. Die Ausgabe jeder Zeile ist wie diese.
> Notice (8): Undefined variable: location [APP\views\locations
> \view.ctp, line 1]
> [...]
Wenn der Code wirklich Copy & Paste ist, liegt der Fehler darin, dass
Du im Controller 'locatiion' statt 'location' setzt. Ansonsten einfach
mal ausgeben, was in Controller und view ankommt:
function view($id = NULL) {
$this->Location->id = $id;
$data = $this->Location->read();
pr($data);
$this->set('location',$data);
}
Analog im view einfach mal pr($location); einsetzen um zu sehen, was
genau ankommt.
Viele Grüße,
Dirk
--~--~---------~--~----~------------~-------~--~----~
Bitte bei Fragen immer auch die aktuell verwendete cakePHP Version angeben und
wenn möglich auch das verwendete Betriebssystem und die PHP Version. Danke.
Sie erhalten diese Nachricht, weil Sie Mitglied sind von Google Groups-Gruppe
"CakePHP-de für deutsche CakePHP Entwickler".
Für das Erstellen von Beiträgen in dieser Gruppe senden Sie eine E-Mail
an [email protected]
Um sich von dieser Gruppe abzumelden, senden Sie eine E-Mail an [EMAIL
PROTECTED]
Weitere Optionen finden Sie in dieser Gruppe unter
http://groups.google.com/group/cakephp-de?hl=de
-~----------~----~----~----~------~----~------~--~---