It's $actsAs, not $actAs. Jeremy Burns Class Outfit
jeremybu...@classoutfit.com http://www.classoutfit.com On 28 Jan 2011, at 02:44, raymond wrote: > Hi. > I have tried Tree behavior just according to manual, but it reports > error following: > > 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 'generatetreelist' at line 1 > Query: generatetreelist > > I debugged and found that cakePHP does not understand the method > generatetreelist() > > I have created table 'lkp_itemcate' with following columns: > id, parent_id, lft, rght, name, img_url, level, created, modified. > > And then created model file: > > class Itemcate extends AppModel { > var $name = 'Itemcate'; > var $tablePrefix = 'lkp_'; > var $useTable = 'itemcate'; > > var $actAs = array('Tree'); > } > > and inserted following code to controller action: > > $list = $this->Itemcate->generatetreelist(null, null, null, > ' '); > > Any advice? > Thanks. > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php