You should only need to specify the parent_id, which points to the ID
of the parent Category. So, when you go to /categories/add you should
pass the parent_id (so you can create a hidden element) OR have
something like a select list named for Category.parent_id.
For instance, in a CMS app i've been building, the
ContentsController::add method has:
$this->set('links', $this->Content->generatetreelist(null,
'{n}.Content.id', '{n}.Content.name', '--'));
In the view:
$form->select('Content.parent_id', $links, null, array(), true)
On Sat, Mar 21, 2009 at 9:23 PM, Dave Maharaj :: WidePixels.com
<[email protected]> wrote:
> Sorry I got it... my bad.
>
> But as I read thru the add part... how do I add to a Category? I figured it
> would be a drop down with the categories to select from to add a new item to
> new parent? Is this not the case? You have to add it knowing the parent_id
> in the controller itself?
>
> Is there any documentation other than the cookbook that has more details?
> When I try to simply Bake the MVC for Categories it comes up no parent table
> found....
>
> Dave
> ________________________________
> From: Dave Maharaj :: WidePixels.com [mailto:[email protected]]
> Sent: March-21-09 10:37 PM
> To: [email protected]
> Subject: Tree Behaviour help
>
> I am following along on the Cake site
> http://book.cakephp.org/view/228/Basic-Usage to set up the tree table in the
> database.
>
> I get error Missing database table 'parents' for model 'Parent'. This is all
> new to me so I am not sure about the parent? Can someone provide some
> assistance on this? What am missing here? Obviously the Parent but is this
> something defined in the controller? Database?
>
> Thanks
>
> Dave
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---