I'm trying to make a behavior for my site, but I can not make it work.
I'm using cakePHP 1.2 This is what I have so far:
Model:
// apple.php
<?php
class Apple extends AppModel {
var $name = 'Apple';
var $actAs = array('A');
... etc ...
Behavior
// a.php
<?php
class ABehavior extends ModelBehavior {
function setup(&$model, $config = array ()) {
$this->settings[$model->name] = $settings;
}
function test(&$model) {
return "test";
}
}
?>
And in the controller, where I added the model, in a function:
print $this->Apple->test();
If I have debugging on, I get an error with one query with output
'test'. What is the thing I'm doing wrong?
Greetz,
Bob
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---