4
I have this in the Passage.php model:
<?php
class Passagem extends AppModel {
public $name = 'Passagem';
}?>
And this in Passagenscontroller.php:
<?php
class PassagensController extends AppController {
public $helpers = array('Html','Form');
public $name = 'Passagens';
public $components = array('Session');
function index(){
$this->set('passagens', $this->Passagem->find('all'));
}
}?>
The moment I access the Tickets page, an error occurs with that description:
"Error: Call to a Member Function find() on a non-object File: C: wamp www Salepassages app Controller Passagenscontroller.php Line: 8"
Note: In the project there are other Models and Controllers. But, only in "Passages" this error occurs.
What can it be?
This should really solve. I think the problem is that cake does not know that the singular of passages is passage.
– bfavaretto
Exactly, if it was Passage I believe that it would work automatically, but as you used Pt-BR it can not identify.
– Rhenann
I did this... Look what happens: Error: Table passgems for model Passage was not found in datasource default. Very strange that "passes" !!!
– Tercio
@Third The reason is the same. Or you add one
public $useTable = 'passagem';
model, or create a new inflection to teach cake to convert singular/plural right.– bfavaretto
I agree with @bfavaretto. It’s all about the singular/plural that the cake inflection rule doesn’t interpret in English.
– Rhenann
Fixed!!! Thank you all!!! I put the inflections.php and it worked all right!
– Tercio