Hi,
I created a Controller called battles_controller.php and a model
called battle.php.
There is a function in the model called GetStats. I tried to call this
function with:
$this-Battle-GetStats(); I got error:
Notice (8): Undefined property: BattlesController::$Battle [APP/
Are your controller missing the $uses definition, with which you tell
the controller, that it should use a model?
See the CakePHP book at:
http://book.cakephp.org/view/53/components-helpers-and-uses
[code]
var $uses = array('Battle');
[/code]
Enjoy,
John
On Feb 21, 5:40 pm, Thau
Right on! I have a list of nine other models used by the
talent_controller and I had forgotten to add the TalentDelail model to
the list!
do you need to load all these models directly? If they have
associations set up, you should only need a couple in Uses, and the
rest will be available via
A table in the db: talent_details
The model:
class TalentDetail extends AppModel
{
var $name = 'TalentDetail';
var $primaryKey = 'recordID';
}
In the controller talent_controller:
$this-TalentDetail-id = 10;
$result = $this-TalentDetail-exits();
Result:
Fatal error: Call to undefined
The name of your model doesn't correspond with your controller.
Your controller name should be talent_detail_controller if you want to
keep it that way, but I'm guessing you want it to show up in your
browser as /talent/.
So, in order to fix this you'll want to add $uses =
Right on! I have a list of nine other models used by the
talent_controller and I had forgotten to add the TalentDelail model to
the list!
The devil is in the details!!
Thanks for your help.
Peter -
On Aug 19, 3:40 pm, housebolt [EMAIL PROTECTED] wrote:
The name of your model doesn't
On Mar 22, 9:02 pm, Samuel DeVore [EMAIL PROTECTED] wrote:
So sometimes when I want to know how the inflector works on things i
make a test view like
http://bin.cakephp.org/view/455901280
Good idea, thanks! I used your view with my table/class/filename and
here's the output I get:
On Mar 23, 1:31 am, aerosmith [EMAIL PROTECTED] wrote:
I think you must create your controller as the following:
//app\controllers\trading_systems_controller_controller.php
class TradingSystemsController extends AppController
{
var $name = 'TradingSystems';
}
take a look at your
Can you paste your controller? Specifically, the class variables.
Not sure what you mean by class variables. Here's the entire
controller:
?php
class TradingSystemsController extends AppController {
var $scaffold;
//var $uses = array('TradingSystem');
function index() {
Most Welcome...
Regards
Raffi
On Mar 23, 7:40 pm, lamacq [EMAIL PROTECTED] wrote:
On Mar 23, 1:31 am, aerosmith [EMAIL PROTECTED] wrote:
I think you must create your controller as the following:
//app\controllers\trading_systems_controller_controller.php
class TradingSystemsController
://localhost/trading_systems/ I get this message:
Missing Model
No class found for the Tradingsystem model
And it wants me to create this class in app\models\tradingsystem.php:
?php
class Tradingsystem extends AppModel {
var $name = 'Tradingsystem';
}
But I already have
?php
class
Hi lamacq
My guess is that there is an inflection problem, and that Cake is
getting confused by the S on the start of the 'System' part of the name.
I can't offer any suggestions as to why though. I have never studied
the inflection system, but I have come across inflection issues in the
lamacq [EMAIL PROTECTED] wrote:
Any ideas?
Can you paste your controller? Specifically, the class variables.
--
Chris Lamb, Leamington Spa, UKGPG: 0x634F9A20
signature.asc
Description: PGP signature
So sometimes when I want to know how the inflector works on things i
make a test view like
http://bin.cakephp.org/view/455901280
in the views/pages
On 3/22/07, Chris Lamb [EMAIL PROTECTED] wrote:
lamacq [EMAIL PROTECTED] wrote:
Any ideas?
Can you paste your controller? Specifically,
. I've got a
table named trading_systems, a controller named
TradingSystemsController in controllers/
trading_systems_controller.php, and my model is named TradingSystem
and is in the file models/trading_system.php.
When I accesshttp://localhost/trading_systems/I get this message:
Missing Model
15 matches
Mail list logo