Re: How do I make a Behavior?

2007-07-31 Thread [EMAIL PROTECTED]

Query: test

Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near 'test' at line 1 [CORE/cake/libs/model/
datasources/dbo_source.php, line 463]


On Jul 31, 7:09 am, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On 7/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



  If I have debugging on, I get an error with one query with output
  'test'. What is the thing I'm doing wrong?

 What is the error?

 T

 --
 =
 Cheesecake-Photoblog:http://cheesecake-photoblog.org
 PHP for E-Biz:http://sanisoft.com
 =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How do I make a Behavior?

2007-07-31 Thread Dr. Tarique Sani
On 7/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 Query: test

 Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
 check the manual that corresponds to your MySQL server version for the
 right syntax to use near 'test' at line 1 [CORE/cake/libs/model/
 datasources/dbo_source.php, line 463]


Duh!

use var $actsAs = array('A'); and not var $actAs = array('A');

Well even I missed that :)

T

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How do I make a Behavior?

2007-07-31 Thread Bob Voorneveld
What stupid, thanks for your help!

2007/7/31, Dr. Tarique Sani [EMAIL PROTECTED]:

 On 7/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 
  Query: test
 
  Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
  check the manual that corresponds to your MySQL server version for the
  right syntax to use near 'test' at line 1 [CORE/cake/libs/model/
  datasources/dbo_source.php, line 463]


 Duh!

 use var $actsAs = array('A'); and not var $actAs = array('A');

 Well even I missed that :)

 T

 --
 =
 Cheesecake-Photoblog: http://cheesecake-photoblog.org
 PHP for E-Biz: http://sanisoft.com
 =
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



How do I make a Behavior?

2007-07-30 Thread [EMAIL PROTECTED]

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 cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How do I make a Behavior?

2007-07-30 Thread Dr. Tarique Sani
On 7/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 If I have debugging on, I get an error with one query with output
 'test'. What is the thing I'm doing wrong?


What is the error?

T

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---